aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2017-04-22Automatic date update in version.inGDB Administrator1-1/+1
2017-04-21i386: Avoid dynamic symbol with GOT reference in PIEH.J. Lu2-18/+57
GOT reference to global symbol in PIE will lead to dynamic symbol. It becomes a problem when "time" or "times" is defined as a variable in an executable, clashing with functions of the same name in libc. If a symbol isn't undefined weak symbol, don't make it dynamic in PIE and generate R_386_RELATIVE relocation. bfd/ PR ld/21402 * elf32-i386.c (elf_i386_link_hash_entry): Add no_finish_dynamic_symbol. (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0. (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak symbol, don't make it dynamic in PIE. (elf_i386_relocate_section): If a symbol isn't dynamic in PIE, set no_finish_dynamic_symbol and generate R_386_RELATIVE relocation for R_386_GOT32 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol isn't 0. ld/ PR ld/21402 * testsuite/ld-elf/indirect.exp: Don't skip PIE indirect5 and indirect6 tests on i386.
2017-04-21Require --no-dynamic-linker with -static -E/--dynamic-listH.J. Lu2-0/+9
When -static -E/--dynamic-list are passed to linker, linker may create executable with dynamic sections which aren't supported by run-time. We require --no-dynamic-linker together with -static -E/--dynamic-list before adding dynamic symbol table to static executable. bfd/ PR ld/19617 PR ld/21086 * elflink.c (elf_link_add_object_symbols): Require --no-dynamic-linker with -E/--dynamic-list when creating dynamic sections. ld/ PR ld/19617 PR ld/21086 * testsuite/ld-elf/pr19617a.d: Pass --no-dynamic-linker to ld. * testsuite/ld-elf/pr19617b.d: Likewise. * testsuite/ld-elf/pr19617c.d: Likewise. *testsuite/ld-i386/pr19636-4d.d: Likewise. * testsuite/ld-elf/readelf.exp: Pass --no-dynamic-linker to ld with --export-dynamic. * testsuite/ld-elf/shared.exp: Pass --no-dynamic-linker to ld with -E.
2017-04-21Automatic date update in version.inGDB Administrator1-1/+1
2017-04-20ELF/LD: Always consider STB_LOCAL symbols localMaciej W. Rozycki2-9/+14
Do not require forced local (STB_LOCAL) symbols to have a definition in a regular file to be considered to resolve local to the current module, matching `elf_link_renumber_local_hash_table_dynsyms'. In the absence of a regular definition any reference to a STB_LOCAL symbol will have to be garbage collected along with the undefined symbol itself, or the link will eventually fail. Either way the symbol concerned is not going to be external. bfd/ * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE if forced local.
2017-04-20MIPS/BFD: Reorder comment about dynamic symbol sortingMaciej W. Rozycki2-2/+7
Move the comment about dynamic symbol sorting next to where it happens. bfd/ * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about dynamic symbol sorting.
2017-04-20Handle symbol defined in IR and referenced in DSOH.J. Lu2-0/+13
We need to make an IR symbol visible if it is defined in an IR object and referenced in a dynamic object. When --as-needed is used, since linker removes the IR symbol reference of the dynamic object if the dynamic object isn't needed in the first pass, the IR definition isn't visible to the dynamic object even if the dynamic object becomes needed in the second pass. Add dynamic_ref_after_ir_def to bfd_link_hash_entry to track IR symbol which is defined in an IR object and later referenced in a dynamic object. dynamic_ref_after_ir_def is preserved when restoring the symbol table for unneeded dynamic object. bfd/ PR ld/21382 * elflink.c (elf_link_add_object_symbols): Preserve dynamic_ref_after_ir_def when restoring the symbol table for unneeded dynamic object. include/ PR ld/21382 * bfdlink.h (bfd_link_hash_entry): Add dynamic_ref_after_ir_def. ld/ PR ld/21382 * plugin.c (is_visible_from_outside): Symbol may be visible from outside if dynamic_ref_after_ir_def is set. (plugin_notice): Set dynamic_ref_after_ir_def if the symbol is defined in an IR object and referenced in a dynamic object. * testsuite/ld-plugin/lto.exp: Run PR ld/21382 tests. * testsuite/ld-plugin/pr21382a.c: New file. * testsuite/ld-plugin/pr21382b.c: Likewise.
2017-04-20Automatic date update in version.inGDB Administrator1-1/+1
2017-04-19x86-64: Handle undefined IFUNC symbol with -z nowH.J. Lu2-1/+7
Since undefined IFUNC symbol is treated as normal FUNC symbol, don't abort on undefined IFUNC symbol in the second PLT. bfd/ PR ld/21401 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort on on undefined IFUNC symbol in the second PLT. ld/ PR ld/21401 * testsuite/ld-ifunc/ifunc.exp: Add a libtest-2-now.so test with -z now.
2017-04-19Correct PE reloc displayWedson Almeida Filho2-1/+5
* peXXigen.c (pe_print_reloc): Correct chunk_end.
2017-04-19Implement -z dynamic-undefined-weakAlan Modra4-31/+73
-z nodynamic-undefined-weak is only implemented for x86. (The sparc backend has some support code but doesn't enable the option by including ld/emulparams/dynamic_undefined_weak.sh, and since the support looks like it may be broken I haven't enabled it.) This patch adds the complementary -z dynamic-undefined-weak, extends both options to affect building of shared libraries as well as executables, and adds support for the option on powerpc. include/ * bfdlink.h (struct bfd_link_info <dynamic_undefined_weak>): Revise comment. bfd/ * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak or make dynamic for info->dynamic_undefined_weak 0 and 1. * elf32-ppc.c:Formatting. (ensure_undefweak_dynamic): Don't make dynamic when info->dynamic_undefined_weak is zero. (allocate_dynrelocs): Discard undefweak dyn_relocs for info->dynamic_undefined_weak. Discard undef dyn_relocs when not default visibility. Discard undef and undefweak dyn_relocs earlier. (ppc_elf_relocate_section): Adjust to suit. * elf64-ppc.c: Formatting. (ensure_undefweak_dynamic): Don't make dynamic when info->dynamic_undefined_weak is zero. (allocate_dynrelocs): Discard undefweak dyn_relocs for info->dynamic_undefined_weak. Discard them earlier. ld/ * ld.texinfo (dynamic-undefined-weak): Document. (nodynamic-undefined-weak): Document that this option now can be used with shared libs. * emulparams/dynamic_undefined_weak.sh: Support -z dynamic-undefined-weak. * emulparams/elf32ppccommon.sh: Include dynamic_undefined_weak.sh. * testsuite/ld-undefined/weak-undef.exp (undef_weak_so), (undef_weak_exe): New. Use them. Add -z dynamic-undefined-weak and -z nodynamic-undefined-weak tests. * Makefile.am: Update powerpc dependencies. * Makefile.in: Regenerate.
2017-04-19Automatic date update in version.inGDB Administrator1-1/+1
2017-04-18Automatic date update in version.inGDB Administrator1-1/+1
2017-04-17Put soname in the version definition sectionH.J. Lu2-12/+18
commit 902e9fc76a0ec9f642cefa71ef88cca1c675ad54 Author: Maciej W. Rozycki <macro@imgtec.com> Date: Tue Feb 21 01:46:42 2017 +0000 PR ld/20828: Move symbol version processing ahead of GC symbol sweep breaks version definition with --version-script --soname. This patch fixes it by getting soname index before generating the version definition section. bfd/ PR ld/21389 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index before generating the version definition section. ld/ PR ld/21389 * testsuite/ld-elf/pr21389.map: New file. * testsuite/ld-elf/pr21389.s: Likewise. * testsuite/ld-elf/pr21389a.d: Likewise. * testsuite/ld-elf/pr21389b.d: Likewise. * testsuite/ld-elf/pr21389c.d: Likewise.
2017-04-17Undo dynamic symbol state after regular object sym type mismatchAlan Modra2-13/+46
We already handle the case of an object file first defining a symbol that a later shared library also defines where the symbol types are incompatible. This patch handles the reverse, when a later object file defines an incompatible symbol defined by an earlier shared library. bfd/ * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking state when a regular object file defines a symbol with incompatible type to that defined by an earlier shared lib. ld/ * testsuite/ld-elf/indirect5a.c, * testsuite/ld-elf/indirect5b.c, * testsuite/ld-elf/indirect5.map, * testsuite/ld-elf/indirect5.out: New test. * testsuite/ld-elf/indirect6a.c: Likewise. * testsuite/ld-elf/indirect.exp (check_dynamic_syms): New proc. Run new tests and check dynsyms.
2017-04-17Automatic date update in version.inGDB Administrator1-1/+1
2017-04-16Automatic date update in version.inGDB Administrator1-1/+1
2017-04-15Automatic date update in version.ingdb-8.0-branchpointGDB Administrator1-1/+1
2017-04-14Automatic date update in version.inGDB Administrator1-1/+1
2017-04-13Wrap long linesAlan Modra11-40/+81
Not a comprehensive change, just some split out from fixes made for the %A and %B changes. * coffcode.h: Wrap some overly long _bfd_error_handler args. * elf.c: Likewise. * elf32-arm.c: Likewise. * elf32-i386.c: Likewise. * elf32-mep.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-x86-64.c: Likewise. * elflink.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise.
2017-04-13Use %A and %B in more error messagesAlan Modra50-314/+341
* aoutx.h: Use %B and %A in error messages throughout file. * aout-cris.c: Likewise. * archive.c: Likewise. * binary.c: Likewise. * coff-rs6000.c: Likewise. * coff-tic4x.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * coffswap.h: Likewise. * cpu-arm.c: Likewise. * elf-eh-frame.c: Likewise. * elf-m10300.c: Likewise. * elf.c: Likewise. * elf32-arc.c: Likewise. * elf32-arm.c: Likewise. * elf32-bfin.c: Likewise. * elf32-frv.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-microblaze.c: Likewise. * elf32-nds32.c: Likewise. * elf32-rl78.c: Likewise. * elf32-rx.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-sh64.c: Likewise. * elf32-v850.c: Likewise. * elf32-vax.c: Likewise. * elf32-visium.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-sh64.c: Likewise. * elfcode.h: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise. * hpux-core.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * linker.c: Likewise. * merge.c: Likewise. * mmo.c: Likewise. * oasys.c: Likewise. * pdp11.c: Likewise. * peXXigen.c: Likewise. * rs6000-core.c: Likewise. * vms-alpha.c: Likewise. * xcofflink.c: Likewise.
2017-04-13Rewrite bfd error handlerAlan Modra21-271/+361
This steals _doprnt from libiberty, extended to handle %A and %B. Which lets us do away with the current horrible %A and %B handling that requires all %A and %B arguments to be passed first, rather than in the natural order. * bfd.c (PRINT_TYPE): Define. (_doprnt): New function. (error_handler_internal): Use _doprnt. * coff-arm.c: Put %A and %B arguments to _bfd_error_handler calls in their natural order, throughout file. * coff-mcore.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * cofflink.c: Likewise. * elf-s390-common.c: Likewise. * elf.c: Likewise. * elf32-arm.c: Likewise. * elf32-i386.c: Likewise. * elf32-m32r.c: Likewise. * elf32-msp430.c: Likewise. * elf32-spu.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise.
2017-04-13Missing _bfd_error_handler argsAlan Modra4-25/+33
* elf32-arm.c (arm_type_of_stub): Supply missing args to "long branch veneers" error. Fix double space and format message. * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg. * elf64-ppc.c (tocsave_find): Supply missing %B arg.
2017-04-13Regen bfd-in2.hAlan Modra2-1/+6
* bfd-in2.h: Regenerate.
2017-04-13Automatic date update in version.inGDB Administrator1-1/+1
2017-04-12Automatic date update in version.inGDB Administrator1-1/+1
2017-04-11Remove the extra `\n' in warning/error messagesH.J. Lu4-9/+16
* elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the extra `\n' in warning/error messages. * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise. * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2017-04-11Ignore processor-specific GNU program propertiesH.J. Lu2-1/+14
Skip processor-specific GNU program properties with generic ELF target vector. They should be handled by the matching ELF target vector. * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore processor-specific properties with generic ELF target vector.
2017-04-11Automatic date update in version.inGDB Administrator1-1/+1
2017-04-10Port the bug fix for PR 19704 (Missing dynamic relocation against undefined ↵Qing Zhao5-28/+228
weak symbol) to the SPARC architecture. * elf32-sparc.c (elf_backend_fixup_symbol): New. * elf64-sparc.c (elf_backend_fixup_symbol): New. * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New. (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and has_non_got_reloc. (link_hash_newfunc): Initialize has_got_reloc and has_non_got_reloc. (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp section. (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and has_non_got_reloc. (_bfd_sparc_elf_check_relocs): Set has_got_reloc and has_non_got_reloc. (_bfd_sparc_elf_fixup_symbol): New function. (allocate_dynrelocs): Don't allocate space for dynamic relocations and discard relocations against resolved undefined weak symbols in executable. Don't make resolved undefined weak symbols in executable dynamic. Keep dynamic non-GOT/non-PLT relocation against undefined weak symbols in PIE. (_bfd_sparc_elf_relocate_section): Don't generate dynamic relocations against resolved undefined weak symbols in PIE (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries without ynamic PLT/GOT relocations for resolved undefined weak symbols. Don't generate dynamic relocation against resolved undefined weak symbol in executable. (pie_finish_undefweak_symbol): New function. (_bfd_sparc_elf_finish_dynamic_sections): Call pie_finish_undefweak_symbol on all symbols in PIE. * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp. (_bfd_sparc_elf_fixup_symbol): New function.
2017-04-10Remove the ns32k target from the obsolete list.Nick Clifton2-1/+4
* config.bfd: Remove ns32k from obsolete list.
2017-04-10PR21287, Inconsistent section type for .init_array and .init_array.42Alan Modra2-10/+17
PR21287 notes that .init_array is correctly given a type of SHT_INIT_ARRAY while .init_array.nnn gets SHT_PROGBITS. This patch fixes that problem, and properly drops warnings from the compiler that would cause the testsuite to fail. My a44d0bd78 change to check ld_compile status, necessary to pick up compile errors, also meant warnings were not ignored. bfd/ PR 21287 * elf.c (special_sections_f): Match .fini_array and .fini_array.*. (special_sections_i): Likewise for .init_array. (special_sections_p): Likewise for .preinit_array. ld/ PR 21287 * testsuite/ld-elf/init-fini-arrays.d: Match INIT_ARRAY and FINI_ARRAY. * testsuite/ld-elf/init-fini-arrays.s: Use %init_array and %fini_array section types. * testsuite/lib/ld-lib.exp (default_ld_compile): Trim assembler warnings about "ignoring incorrect section type". (run_ld_link_exec_tests, run_cc_link_tests): Delete old comment.
2017-04-10Automatic date update in version.inGDB Administrator1-1/+1
2017-04-09Automatic date update in version.inGDB Administrator1-1/+1
2017-04-08Automatic date update in version.inGDB Administrator1-1/+1
2017-04-07ELF: Check ELF_COMMON_DEF_P for common symbolsH.J. Lu5-8/+18
Since common symbols that are turned into definitions don't have the DEF_REGULAR flag set, we need to check ELF_COMMON_DEF_P for common symbols. bfd/ PR ld/19579 PR ld/21306 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check ELF_COMMON_DEF_P for common symbols. * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise. * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise. * elflink.c (_bfd_elf_merge_symbol): Revert commits 202ac193bbbecc96a4978d1ac3d17148253f9b01 and 07492f668d2173da7a2bda3707ff0985e0f460b6. ld/ PR ld/19579 PR ld/21306 * testsuite/ld-elf/pr19579a.c (main): Updated.
2017-04-07Fix building the BFD library for Win64 by reqorking the ↵Pedro Alves2-94/+163
find_separate_debug_file interface. * opncls.c (bfd_get_debug_link_info): Rename to... (bfd_get_debug_link_info_1): ... this. Change type of second parameter to void pointer. Adjust. (bfd_get_debug_link_info): Reimplement on top of bfd_get_debug_link_info_1. (separate_debug_file_exists, separate_alt_debug_file_exists): Change type of second parameter to void pointer. Adjust. (get_func_type, check_func_type): Change type of second parameter to void pointer. (find_separate_debug_file): Add 'func_data' parameter. Pass it to the callback functions instead of passing the address of a local. (bfd_follow_gnu_debuglink): Pass address of unsigned long local to find_separate_debug_file. (get_alt_debug_link_info_shim): Change type of second parameter to void pointer. Adjust. (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to find_separate_debug_file. (get_build_id_name, bfd_boolean check_build_id_file): Change type of second parameter to void pointer. Adjust. (bfd_follow_build_id_debuglink): Pass address of bfd_build_id pointer local to find_separate_debug_file.
2017-04-07pe/coff: handle weak defined symbol for gc-sections.Tristan Gingold2-2/+22
bfd/ * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak external symbols with a definition. (_bfd_coff_gc_mark_extra_sections): Fix typo. ld/ * testsuite/ld-pe/pe.exp: New test. * testsuite/ld-pe/weakdef-1.s: New test source. * testsuite/ld-pe/weakdef-1.d: New test.
2017-04-07Automatic date update in version.inGDB Administrator1-1/+1
2017-04-07Regen SRC-POTFILES.inAlan Modra2-0/+5
Missed when elf-properties.c was added. * po/SRC-POTFILES.in: Regenerate.
2017-04-06Automatic date update in version.inGDB Administrator1-1/+1
2017-04-05PowerPC64le PLT reference countingAlan Modra2-11/+35
A fix for ELFv2 ABI garbage-collection. * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT reference counting.
2017-04-05Automatic date update in version.inGDB Administrator1-1/+1
2017-04-04Use symbolic constants instead of magic numbers with add_data_entry()Jon Turney2-5/+11
Use symbolic constants from include/coff/internal.h instead of magic numbers with add_data_entry() bfd/ChangeLog: 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk> (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than numbers for DataDirectory entry indicies passed to add_data_entry().
2017-04-04Support ELF SHF_GNU_MBIND and PT_GNU_MBIND_XXXH.J. Lu2-2/+73
Mark an ALLOC section, which should be placed in special memory area, with SHF_GNU_MBIND. Its sh_info field indicates the special memory type. GNU_MBIND section names start with ".mbind" so that they are placed as orphan sections by linker. All input GNU_MBIND sections with the same sh_type, sh_flags and sh_info are placed in one output GNU_MBIND section. In executable and shared object, create a GNU_MBIND segment for each GNU_MBIND section and its segment type is PT_GNU_MBIND_LO plus the sh_info value. Each GNU_MBIND segment is aligned at page boundary. The assembler syntax: .section .mbind.foo,"adx",%progbits ^ 0: Special memory type. | 'd' for SHF_GNU_MBIND. .section .mbind.foo,"adx",%progbits,0x1 ^ 1: Special memory type. | 'd' for SHF_GNU_MBIND. .section .mbind.bar,"adG",%progbits,.foo_group,comdat,0x2 ^ 2: Special memory type. | 'd' for SHF_GNU_MBIND. bfd/ * elf.c (get_program_header_size): Add a GNU_MBIND segment for each GNU_MBIND section and align GNU_MBIND section to page size. (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND segment for each GNU_MBIND section. (_bfd_elf_init_private_section_data): Copy sh_info from input for GNU_MBIND section. binutils/ * NEWS: Mention support for ELF SHF_GNU_MBIND and PT_GNU_MBIND_XXX. * readelf.c (get_segment_type): Handle PT_GNU_MBIND_XXX. (get_elf_section_flags): Handle SHF_GNU_MBIND. (process_section_headers): Likewise. * testsuite/binutils-all/mbind1.s: New file. * testsuite/binutils-all/objcopy.exp: Run readelf test on mbind1.s. gas/ * NEWS: Mention support for ELF SHF_GNU_MBIND. * config/obj-elf.c (section_match): New. (get_section): Match both sh_info and group name. (obj_elf_change_section): Add argument for sh_info. Pass both sh_info and group name to get_section. Issue an error for SHF_GNU_MBIND section without SHF_ALLOC. Set sh_info. (obj_elf_parse_section_letters): Set SHF_GNU_MBIND for 'd'. (obj_elf_section): Support SHF_GNU_MBIND section info. * config/obj-elf.h (obj_elf_change_section): Add argument for sh_info. * config/tc-arm.c (start_unwind_section): Pass 0 as sh_info to obj_elf_change_section. * config/tc-ia64.c (obj_elf_vms_common): Likewise. * config/tc-microblaze.c (microblaze_s_data): Likewise. (microblaze_s_sdata): Likewise. (microblaze_s_rdata): Likewise. (microblaze_s_bss): Likewise. * config/tc-mips.c (s_change_section): Likewise. * config/tc-msp430.c (msp430_profiler): Likewise. * config/tc-rx.c (parse_rx_section): Likewise. * config/tc-tic6x.c (tic6x_start_unwind_section): Likewise. * doc/as.texinfo: Document 'd' for SHF_GNU_MBIND. * testsuite/gas/elf/elf.exp: Run section12a, section12b and section13. * testsuite/gas/elf/section10.d: Updated. * testsuite/gas/elf/section10.s: Likewise. * testsuite/gas/elf/section12.s: New file. * testsuite/gas/elf/section12a.d: Likewise. * testsuite/gas/elf/section12b.d: Likewise. * testsuite/gas/elf/section13.l: Likewise. * testsuite/gas/elf/section13.d: Likewise. * testsuite/gas/elf/section13.s: Likewise. include/ * elf/common.h (PT_GNU_MBIND_NUM): New. (PT_GNU_MBIND_LO): Likewise. (PT_GNU_MBIND_HI): Likewise. (SHF_GNU_MBIND): Likewise. ld/ * NEWS: Mention support for ELF SHF_GNU_MBIND and PT_GNU_MBIND_XXX. * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Place input GNU_MBIND sections with the same type, attributes and sh_info field into a single output GNU_MBIND section. * testsuite/ld-elf/elf.exp: Run mbind2a and mbind2b. * testsuite/ld-elf/mbind1.s: New file. * testsuite/ld-elf/mbind1a.d: Likewise. * testsuite/ld-elf/mbind1b.d: Likewise. * testsuite/ld-elf/mbind1c.d: Likewise. * testsuite/ld-elf/mbind2a.s: Likewise. * testsuite/ld-elf/mbind2b.c: Likewise.
2017-04-04RISC-V: Resurrect GP-relative disassembly hintsPalmer Dabbelt2-6/+9
We missed a "_gp" when changing the GP symbol. To make sure that doesn't happen again, we now use the same definition everywhere (thanks, Nick). include/ChangeLog: 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com> * elf/riscv.h (RISCV_GP_SYMBOL): New define. bfd/ChangeLog: 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com> * elfnn-riscv.c (GP_NAME): Delete. (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL. (_bfd_riscv_relax_lui): Likewise. opcodes/ChangeLog: 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com> * riscv-dis.c (riscv_disassemble_insn): Change "_gp" to RISCV_GP_SYMBOL.
2017-04-04Fix null pointer dereferences when using a link built with clang.Nick Clifton2-14/+29
PR binutils/21342 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer dereference. (bfd_elf_final_link): Only initialize the extended symbol index section if there are extended symbol tables to list.
2017-04-04Automatic date update in version.inGDB Administrator1-1/+1
2017-04-03 IA16 supportAndrew Jenner1-0/+6
* config.sub: Handle ia16 in $basic_machine. bfd/ * config.bfd: Handle ia16. gas/ * configure.tgt: Handle ia16. ld/ * configure.tgt: Handle ia16.
2017-04-03ld: Support ELF GNU program propertiesH.J. Lu11-3/+747
From .note.gnu.property section in each ELF input, we build a list of GNU properties if .note.gnu.property section isn't corrupt. The unknown properties are ignored. All property lists in relocatable inputs are merged into an output property list. When -z stack-size=N is used and N isn't 0, the GNU_PROPERTY_STACK_SIZE property will be merged with or added to the output property list. .note.gnu.property section is generated in output from the output property list. bfd/ * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo. (BFD32_BACKENDS_CFILES): Add elf-properties.c. * configure.ac (elf): Add elf-properties.lo. * Makefile.in: Regenerated. * configure: Likewise. * elf-bfd.h (elf_property_kind): New. (elf_property): Likewise. (elf_property_list): Likewise. (elf_properties): Likewise. (_bfd_elf_parse_gnu_properties): Likewise. (_bfd_elf_get_property): Likewise. (_bfd_elf_link_setup_gnu_properties): Likewise. (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties and setup_gnu_properties. (elf_obj_tdata): Add properties. * elf-properties.c: New file. * elf32-i386.c (elf_i386_parse_gnu_properties): New. (elf_i386_merge_gnu_properties): Likewise. (elf_backend_parse_gnu_properties): Likewise. (elf_backend_merge_gnu_properties): Likewise. * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise. (elf_x86_64_merge_gnu_properties): Likewise. (elf_backend_parse_gnu_properties): Likewise. (elf_backend_merge_gnu_properties): Likewise. * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise. (elf_backend_parse_gnu_properties): Likewise. (elf_backend_setup_gnu_properties): Likewise. (elfNN_bed): Add elf_backend_parse_gnu_properties, elf_backend_merge_gnu_properties and elf_backend_setup_gnu_properties. ld/ * ld/NEWS: Mention support for ELF GNU program properties. * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Call ELF setup_gnu_properties. * testsuite/ld-i386/i386.exp: Run property tests for Linux/i386. * testsuite/ld-i386/pass.c: New file. * testsuite/ld-i386/property-1.r: Likewise. * testsuite/ld-i386/property-2.r: Likewise. * testsuite/ld-i386/property-3.r: Likewise. * testsuite/ld-i386/property-4.r: Likewise. * testsuite/ld-i386/property-5.r: Likewise. * testsuite/ld-i386/property-6.r: Likewise. * testsuite/ld-i386/property-6a.c: Likewise. * testsuite/ld-i386/property-6b.c: Likewise. * testsuite/ld-i386/property-6c.S: Likewise. * testsuite/ld-i386/property-7.r: Likewise. * testsuite/ld-i386/property-no-copy.S: Likewise. * testsuite/ld-i386/property-stack.S: Likewise. * testsuite/ld-i386/property-unsorted-1.S: Likewise. * testsuite/ld-i386/property-unsorted-2.S: Likewise. * testsuite/ld-i386/property-x86-1.S: Likewise. * testsuite/ld-i386/property-x86-2.S: Likewise. * testsuite/ld-x86-64/pass.c: Likewise. * testsuite/ld-x86-64/property-1.r: Likewise. * testsuite/ld-x86-64/property-2.r: Likewise. * testsuite/ld-x86-64/property-3.r: Likewise. * testsuite/ld-x86-64/property-4.r: Likewise. * testsuite/ld-x86-64/property-5.r: Likewise. * testsuite/ld-x86-64/property-6.r: Likewise. * testsuite/ld-x86-64/property-6a.c: Likewise. * testsuite/ld-x86-64/property-6b.c: Likewise. * testsuite/ld-x86-64/property-6c.S: Likewise. * testsuite/ld-x86-64/property-7.r: Likewise. * testsuite/ld-x86-64/property-no-copy.S: Likewise. * testsuite/ld-x86-64/property-stack.S: Likewise. * testsuite/ld-x86-64/property-unsorted-1.S: Likewise. * testsuite/ld-x86-64/property-unsorted-2.S: Likewise. * testsuite/ld-x86-64/property-x86-1.S: Likewise. * testsuite/ld-x86-64/property-x86-2.S: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run property tests for Linux/x86-64.