aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2016-12-10Automatic date update in version.inGDB Administrator1-1/+1
2016-12-09Automatic date update in version.inGDB Administrator1-1/+1
2016-12-08PR20932, Internal error during record link assignmentAlan Modra2-5/+10
PR ld/20932 * elflink.c (bfd_elf_record_link_assignment): Handle warning symbols.
2016-12-08Automatic date update in version.inGDB Administrator1-1/+1
2016-12-07Fix internal error in the linker by replacing a call to abort with an error ↵Nick Clifton2-2/+11
message. PR ld/20932 * elflink.c (bfd_elf_record_link_assignment): Replace call to abort with an error message and error return value.
2016-12-07Automatic date update in version.inGDB Administrator1-1/+1
2016-12-06Fix seg-fault in strip when copying a corrupt binary.Nick Clifton2-0/+14
PR binutils/20931 * elf.c (copy_special_section_fields): Check for an invalid sh_link field before attempting to follow it.
2016-12-06Fix seg-fault running strip on a corrupt binary.Nick Clifton2-6/+17
PR binutils/20929 * aoutx.h (squirt_out_relocs): Check for relocs without an associated symbol.
2016-12-06PowerPC64 toc optimisation for power9Alan Modra2-9/+26
Recognize power9 and a few other insns from older machines. Fixes linker complaints like "toc optimization is not supported for 0xf4090002 instruction". 0xf4090002 is stxsd v0,0(r9) bfd/ * elf64-ppc.c (ok_lo_toc_insn): Add r_type param. Recognize lq,lfq,lxv,lxsd,lxssp,lfdp,stq,stfq,stxv,stxsd,stxssp,stfdp. Don't match lmd and stmd. ld/ * testsuite/ld-powerpc/tocopt7.s, * testsuite/ld-powerpc/tocopt7.out, * testsuite/ld-powerpc/tocopt7.d: New test. * testsuite/ld-powerpc/tocopt8.s, * testsuite/ld-powerpc/tocopt8.d: New test. * testsuite/ld-powerpc/powerpc.exp: Run them.
2016-12-06Automatic date update in version.inGDB Administrator1-1/+1
2016-12-05Fix seg-fault in the binutils utilities when reading a corrupt input file.Nick Clifton2-1/+6
PR binutils/20905 * peicode.h (pe_ILF_object_p): Use strnlen to avoid running over the end of the string buffer.
2016-12-05Fix abort when running tools on a bogus binary.Nick Clifton2-2/+5
PR binutils/20907 * peicode.h (pe_ILF_build_a_bfd): Replace abort with error return.
2016-12-05Fix seg-fault running strip on a corrupt binary.Nick Clifton2-4/+27
PR binutils/20921 * aoutx.h (squirt_out_relocs): Check for and report any relocs that could not be recognised.
2016-12-04bfd,ld: Continue after partially-successful relaxed call relocations in sparc.Alyssa Milburn2-2/+7
bfd/ChangeLog: 2016-12-05 Alyssa Milburn <amilburn@zall.org> * elfxx-sparc.c: Do not stop processing relocations after partially relaxing a call with WDISP30. ld/ChangeLog: 2016-12-05 Alyssa Milburn <amilburn@zall.org> * testsuite/ld-sparc/wdispcall.s: New file. * testsuite/ld-sparc/wdispcall.dd: Likewise. * testsuite/ld-sparc/sparc.exp: Run new test.
2016-12-05Fix seg-fault attempting to strip a corrupt binary.Nick Clifton2-1/+11
PR binutils/20922 * elf.c (find_link): Check for null headers before attempting to match them.
2016-12-05Fix seg-fault in linker parsing a corrupt input file.Nick Clifton2-2/+6
PR ld/20924 (aout_link_add_symbols): Fix off by one error checking for overflow of string offset.
2016-12-05Fix assertion failure in linker triggered by corrupt input file.Nick Clifton2-1/+9
PR ld/20925 * aoutx.h (aout_link_add_symbols): Replace BFD_ASSERT with return FALSE.
2016-12-05fix typoNick Clifton1-1/+1
2016-12-05Automatic date update in version.inGDB Administrator1-1/+1
2016-12-04Automatic date update in version.inGDB Administrator1-1/+1
2016-12-03PowerPC64 dot-symbol compatibility bugfixesAlan Modra3-163/+204
Lots of fixes for the compatibility code that handles linking of -mcall-aixdesc code (or that generated by 12 year old gcc) with current ELFv1 ABI code. 1) A reference to a dot-symbol in an object file wasn't satisfied by a function descriptor in later object files. 2) The as-needed code had bit-rotted; Shared libs now need a strong reference to be counted as needed. 3) --gc-sections involving dot-symbols was broken, needing func_desc_adjust to be run early and lots of other fixes. bfd/ * elf64-ppc.c (struct ppc_link_hash_entry): Delete "was_undefined". (struct ppc_link_hash_table): Delete "twiddled_syms". Add "need_func_desc_adj". (lookup_fdh): Link direct fdh sym via oh field and set flags. (make_fdh): Make strong and weak undefined function descriptor symbols. (ppc64_elf_merge_symbol): New function. (elf_backend_merge_symbol): Define. (ppc64_elf_archive_symbol_lookup): Don't test undefweak for fake function descriptors. (add_symbol_adjust): Don't twiddle symbols to undefweak. Propagate more ref flags to function descriptor symbol. Make some function descriptor symbols dynamic. (ppc64_elf_before_check_relocs): Only run add_symbol_adjust for ELFv1. Set need_func_desc_adj. Don't fix undefs list. (ppc64_elf_check_relocs): Set non_ir_ref for descriptors. Don't call lookup_fdh here. (ppc64_elf_gc_sections): New function. (bfd_elf64_bfd_gc_sections): Define. (ppc64_elf_gc_mark_hook): Mark descriptor. (func_desc_adjust): Don't make fake function descriptor syms strong here. Exit earlier on non-dotsyms. Take note of elf.dynamic flag when deciding whether a dynamic function descriptor might be needed. Transfer elf.dynamic and set elf.needs_plt. Move plt regardless of visibility. Make descriptor dynamic if entry sym is dynamic, not for other cases. (ppc64_elf_func_desc_adjust): Don't run func_desc_adjust if already done. (ppc64_elf_edit_opd): Use oh field rather than lookup_fdh. (ppc64_elf_size_stubs): Likewise. (ppc_build_one_stub): Don't clear was_undefined. Only set sym undefweak if stub symbol is defined. (undo_symbol_twiddle, ppc64_elf_restore_symbols): Delete. * elf64-ppc.h (ppc64_elf_restore_symbols): Don't declare. ld/ * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Don't call ppc64_elf_restore_symbols. * testsuite/ld-powerpc/dotsym1.d: New. * testsuite/ld-powerpc/dotsym2.d: New. * testsuite/ld-powerpc/dotsym3.d: New. * testsuite/ld-powerpc/dotsym4.d: New. * testsuite/ld-powerpc/dotsymref.s: New. * testsuite/ld-powerpc/nodotsym.s: New. * testsuite/ld-powerpc/powerpc.exp: Run new tests.
2016-12-03Tidy ppc64_elf_hide_symbolAlan Modra2-7/+8
* elf64-ppc.c (ppc64_elf_hide_symbol): Access hash table as elf_link_hash_table rather than ppc_link_hash_table.
2016-12-03PowerPC64 add_symbol_adjustAlan Modra2-8/+4
* elf64-ppc.c (add_symbol_adjust): Delete dead code.
2016-12-03Indirect and warning symbolsAlan Modra2-3/+8
It's possible but unlikely that an indirect symbol points at a warning symbol. * elf64-ppc.c (add_symbol_adjust): Correct order of tests for warning and indirect symbols.
2016-12-03ppc64_elf_copy_indirect_symbol versioned_hidden fixAlan Modra2-13/+21
As per _bfd_elf_link_hash_copy_indirect. * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy dynamic flags when direct symbol is versioned_hidden.
2016-12-03Automatic date update in version.inGDB Administrator1-1/+1
2016-12-02Fix typo in changelog entryNick Clifton1-1/+1
2016-12-02Fix seg-fault in linker when passed a corrupt binary input file.Nick Clifton2-0/+10
PR lf/20908 * elflink.c (bfd_elf_final_link): Check for ELF flavour binaries when following indirect links.
2016-12-02Fix seg-fault in the linker when examining a corrupt binary.Nick Clifton2-2/+7
PR ld/20909 * aoutx.h (aout_link_add_symbols): Fix off-by-one error in check for an illegal string offset.
2016-12-02Always pass a valid section header offset to elf_parse_notesGary Benson2-1/+6
_bfd_elf_make_section_from_shdr calls elf_parse_notes with an offset of -1. This argument is used to calculate Elf_Internal_Note.descpos, which ends up set to a positive but meaningless value. This commit updates _bfd_elf_make_section_from_shdr to pass the correct offset to elf_parse_notes, making Elf_Internal_Note.descpos correct in all cases. bfd/ChangeLog: * elf.c (_bfd_elf_make_section_from_shdr): Pass offset to elf_parse_notes.
2016-12-02Add support for Fushia OS.Josh Conner2-1/+14
* configure.ac: Add fuchsia to targets that use ELF. * configure: Regenerated. bfd * configure.tgt: Add support for fuchsia (OS). gas * configure.tgt: Add support for fuchsia (OS). ld * Makefile.am: Add dependency information for earmelf_fuchsia.c. * Makefile.in: Regenerate. * configure.tgt: Add support for aarch64-*-fuchsia, arm*-*-fuchsia*, and x86_64-*-fuchsia* targets. * emulparams/armelf_fuchsia.sh: New file. * emulparams/armelfb_fuchsia.sh: New file.
2016-12-02Automatic date update in version.inGDB Administrator1-1/+1
2016-12-01Fix accesses to the GOT for AARCH64 operating in 32-bit mode.Yury Norov2-6/+17
PR ld/20868 bfd * elfnn-aarch64.c (elfNN_aarch64_tls_relax): Use 32-bit accesses to the GOT when operating in 32-bit mode. ld * testsuite/ld-aarch64/tls-relax-gd-ie-ilp32.d: New test. * testsuite/ld-aarch64/relocs-ilp32.ld: Linker script for the new test. * testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
2016-12-01Fix handling of MIPS16 HI16 relocs.Ma Jiang2-1/+6
PR ld/16720 * elfxx-mips.c (mips_elf_calculate_relocation): Remove overflow test for HI16 relocs.
2016-12-01Fix a seg-fault disassembling a corrupt binary.Nick Clifton2-0/+10
PR binutils/20892 * aoutx.h (find_nearest_line): Handle the case where the function name is empty.
2016-12-01Fix seg-fault running addr2line on a corrupt binary.Nick Clifton2-4/+18
PR binutils/20891 * aoutx.h (find_nearest_line): Handle the case where the main file name and the directory name are both empty.
2016-12-01Automatic date update in version.inGDB Administrator1-1/+1
2016-11-30Revert accidental elf.c changeAlan Modra2-1/+5
* elf.c (get_program_header_size): Revert accidental change.
2016-11-30PR20886, looping in ppc64_elf_size_stubsAlan Modra2-1/+10
The PR20886 binary is large enough that there are two stub sections servicing .text (which is 88M). It so happens that between one iteration of sizing and the next that one stub section grows while the other shrinks. Since one section is always growing, the loop never terminates. This patch changes the algorithm to not update previous size on shrinking, once we go past a certain number of iterations. PR ld/20886 * elf64-ppc.c (ppc64_elf_size_stubs): Make rawsize max size seen on any pass past STUB_SHRINK_ITER.
2016-11-30Automatic date update in version.inGDB Administrator1-1/+1
2016-11-29Automatic date update in version.inGDB Administrator1-1/+1
2016-11-28Partially revert patch for PR 20815 - do not sort the PT_LOAD segments. ↵Nick Clifton2-65/+21
Non-ordered segments are needed by the Linux kernel. PR ld/20815 * elf.c (phdr_sorter): Delete. (assign_file_positions_except_relocs): Do not sort program headers.
2016-11-28Properly hide hidden versioned symbol in executableH.J. Lu2-28/+34
A hidden versioned symbol in executable should be forced local if it is locally defined, not referenced by shared library and not exported. We must do it before _bfd_elf_link_renumber_dynsyms. bfd/ * elflink.c (_bfd_elf_fix_symbol_flags): Hide hidden versioned symbol in executable. (elf_link_output_extsym): Don't change bind from global to local when linking executable. ld/ * testsuite/ld-elf/indirect.exp: Add a test for PR 18720. * testsuite/ld-elf/pr18720.rd: New file.
2016-11-28Automatic date update in version.inGDB Administrator1-1/+1
2016-11-27Automatic date update in version.inGDB Administrator1-1/+1
2016-11-26Automatic date update in version.inGDB Administrator1-1/+1
2016-11-25Prevent problems with section alignment by not shrinking the .rsrc section.Jon Turney2-20/+8
PR ld/20193 * peXXigen.c (rsrc_process_section): Do not shrink the merged .rsrc section.
2016-11-25Automatic date update in version.inGDB Administrator1-1/+1
2016-11-24[ARM] Bind defined symbol locally in PIEJiong Wang2-1/+8
bfd/ PR target/20737 * elf32-arm.c (elf32_arm_final_link_relocate): Bind defined symbol locally in PIE. ld/ * testsuite/ld-arm/pie-bind-locally-a.s: New test source. * testsuite/ld-arm/pie-bind-locally-b.s: Likewise. * testsuite/ld-arm/pie-bind-locally.d: New testcase. * testsuite/ld-arm/arm-elf.exp: Run new testcase.
2016-11-24RISC-V/bfd: Fix bitsize of R_RISCV_ADD8.Kuan-Lin Chen2-1/+5
bfd/ChangeLog: * bfd/elfxx-riscv.c (howto_table): Fix bitsize of R_RISCV_ADD8.