aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2015-03-31Automatic date update in version.inGDB Administrator1-1/+1
2015-03-30Properly set sh_info for .rela.plt/rel.plt sectionH.J. Lu4-8/+57
Since .rela.plt/rel.plt section may contain relocations against .got.plt section, we set sh_info for .rela.plt/rel.plt section to .got.plt section index if target has .got.plt section. bfd/ PR ld/18169 * elf-bfd.h (elf_backend_data): Add get_reloc_section. (_bfd_elf_get_reloc_section): New. * elf.c (_bfd_elf_get_reloc_section): Likewise. (assign_section_numbers): Call get_reloc_section to look up the section the relocs apply. * elfxx-target.h (elf_backend_get_reloc_section): Likewise. (elfNN_bed): Initialize get_reloc_section with elf_backend_get_reloc_section. ld/testsuite/ PR ld/18169 * ld-elf/linkinfo1a.d: Updated. * ld-elf/linkinfo1b.d: Likewise.
2015-03-30Automatic date update in version.inGDB Administrator1-1/+1
2015-03-29Fix a typo in bfd/ChangeLogH.J. Lu1-2/+1
2015-03-29Add --with-system-zlib in bfdH.J. Lu9-130/+76
This patch adds --with-system-zlib and remove --with-zlib in bfd. * Makefile.am (ZLIB): New. (ZLIBINC): Likewise. (AM_CFLAGS): Add $(ZLIBINC). (libbfd_la_LIBADD): Add $(ZLIB). * compress.c: Don't check HAVE_ZLIB_H to include <zlib.h>. (decompress_contents): Don't check HAVE_ZLIB_H. (decompress_contents): Likewise. (bfd_compress_section_contents): Likewise. (bfd_get_full_section_contents): Likewise. (bfd_init_section_decompress_status): Likewise. (bfd_init_section_compress_status): Likewise. * configure.ac (AM_ZLIB): Removed (zlibdir): New. AC_SUBST. (zlibinc): Likewise. Add --with-system-zlib. * Makefile.in: Regenerated. * acinclude.m4: Likewise. * config.in: Likewise. * configure: Likewise. * doc/Makefile.in: Likewise.
2015-03-29Automatic date update in version.inGDB Administrator1-1/+1
2015-03-28Automatic date update in version.inGDB Administrator1-1/+1
2015-03-27Relax PR 15228 protected visibility restrictionAlan Modra3-6/+17
Allows .dynbss copy of shared library protected visibility variables if they are read-only. To recap: Copying a variable from a shared library into an executable's .dynbss is an old hack invented for non-PIC executables, to avoid the text relocations you'd otherwise need to access a shared library variable. This works with ELF shared libraries because global symbols can be overridden. The trouble is that protected visibility symbols can't be overridden. A shared library will continue to access it's own protected visibility variable while the executable accesses a copy. If either the shared library or the executable updates the value then the copy diverges from the original. This is wrong since there is only one definition of the variable in the application. So I made the linker report an error on attempting to copy protected visibility variables into .dynbss. However, you'll notice the above paragraph contains an "If". An application that does not modify the variable value remains correct even though two copies of the variable exist. The linker can detect this situation if the variable was defined in a read-only section. PR ld/15228 PR ld/18167 * elflink.c (elf_merge_st_other): Add "sec" parameter. Don't set protected_def when symbol section is read-only. Adjust all calls. * elf-bfd.h (struct elf_link_hash_entry): Update protected_def comment.
2015-03-27Automatic date update in version.inGDB Administrator1-1/+1
2015-03-26[AArch64] Fix branch stubs for BETejas Belagod2-13/+11
2015-03-26 Tejas Belagod <tejas.belagod@arm.com> ld/testsuite * ld-aarch64/farcall-back-be.d: New. bfd/ * elfnn-aarch64.c (aarch64_build_one_stub): Replace the call to generic _bfd_final_link_relocate with aarch64_relocate.
2015-03-26Skip gc-sections if relocation is incompatibleH.J. Lu2-2/+10
This patch skips gc-sections if input relocation is incompatible with output. bfd/ PR ld/18160 * elflink.c (elf_gc_sweep): Skip if relocation is incompatible. (bfd_elf_gc_sections): Likewise. ld/testsuite/ PR ld/18160 * ld-x86-64/pr18160.d: New file. * ld-x86-64/pr18160.s: Likewise. * ld-x86-64/pr18160.t: Likewise. * ld-x86-64/x86-64.exp: Run pr18160.
2015-03-26Automatic date update in version.inGDB Administrator1-1/+1
2015-03-25[AArch64] Implement branch over stub section.Marcus Shawcroft2-1/+25
Ensure that injection of a stub section does not break a link where there is an xpectation that flow of control can pass from one input section to another simply by linking the input sections in series. The solution here is to allow stub sections to be inserted after any input section (existing behaviour), but inject an additional branch at the start of each stub section such that control flow falling into the stub section will branch over the stub section.
2015-03-25[AArch64] Remove padding before stub sections.Marcus Shawcroft1-1/+1
Lower stub alignment from 8 to 4 bytes thus removing padding between input section content and stub section content.
2015-03-25[AArch64] Adjust veneer count.Marcus Shawcroft2-0/+7
2015-03-25Garbage collecting debug sectionsSenthil Kumar Selvaraj2-1/+5
I noticed that _bfd_elf_gc_mark_extra_sections attempts to unmark related debug sections when it finds an unmarked code section. When it finds .text.foo is unmarked, for example, it removes .debug_line.text.foo as well (using the section name as a suffix match check. However, it bails out after finding one such section. bfd/ * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't break on first matching debug section. ld/testsuite/ * ld-gc/all-debug-sections.d: New file. * ld-gc/all-debug-sections.s: Likewise. * ld-gc/gc.exp: Execute new testcase.
2015-03-25Automatic date update in version.inGDB Administrator1-1/+1
2015-03-24Don't write the zlib header if not usedH.J. Lu2-30/+35
No need to write the zlib header if compression didn't make the section smaller. PR binutils/18087 * compress.c (bfd_compress_section_contents): Don't write the zlib header and set contents as well as compress_status if compression didn't make the section smaller. (bfd_init_section_compress_status): Don't check compression size here.
2015-03-24Fixes a bug introduced by the new ranges checks on COFF symbol tables.Nick Clifton2-2/+7
PR binutils/17512 * coffgen.c (coff_get_normalized_symtab): Fix test for out of range auxillary sections.
2015-03-24[AArch64] Factor out _bfd_aarch64_get_stub_for_link_section.Marcus Shawcroft2-12/+24
2015-03-24[AArch64] Refactor section_group[] representation.Marcus Shawcroft2-12/+8
Change the behaviour of section_group[] such that .stub_sec points to the stub section attached to the indexed section rather than the stub section attached to the link_section pointed to be the index section. This provides a mechanism to get to the stub section following any input section. While still allowing the section grouping mechanism to find the section group stub section associated with an input section by first following the link_sec pointer.
2015-03-24[AArch64] Refactor generation of 835769 workaround stubs.Marcus Shawcroft2-104/+41
This patch recognizes that we only need to perform one scan for the 835769 errata and that this scan can take place before we insert branch stubs. The erratum scan code is relocated and adjusted to create stub entries directly rather than populating an intermediate representation. Since stub entries are created immediately we can drop the adhoc stub size adjustment code and allow the generic stub sizing code to deal with 835769 stub entries. This patch restructures the code but does not change the workaround used to deal with erratum 83679, the exact placement of workaround stubs in the final image may change slightly after this patch due to stubs being created in a different order.
2015-03-24[AArch64] Use _bfd_aarch64_add_stub_entry_in_group.Marcus Shawcroft2-15/+10
Adjust the 835769 workaround code to use _bfd_aarch64_add_stub_entry_in_group rather than inspect the underlying section_group structure directly.
2015-03-24Make powerpc bfd ld reloc overflow vs undefined symbols match goldAlan Modra3-40/+34
* elf64-ppc.c (ppc64_elf_relocate_section): Report overflow to stubs, even those for undefined weak symbols. Otherwise, don't report relocation overflow on branches to undefined strong symbols. Fix memory leak. * elf32-ppc.c (ppc_elf_relocate_section): Don't report relocation overflow on branches to undefined strong symbols.
2015-03-24Automatic date update in version.inGDB Administrator1-1/+1
2015-03-23[OBV] Fix build -- missing ';'Keith Seitz2-1/+6
bfd/ChangeLog * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Add missing ';'.
2015-03-23Adding Changelog for previous commit.Marcus Shawcroft1-0/+6
2015-03-23Factor out _bfd_aarch64_erratum_835769_stub_nameMarcus Shawcroft1-7/+11
2015-03-23[AArch64] Factor out _bfd_aarch64_resize_stubs()Marcus Shawcroft2-12/+30
2015-03-23[AArch64] Factor stub creation code into _bfd_aarch64_create_stub_section.Marcus Shawcroft2-14/+29
2015-03-23[AArch64] Factor out common behaviour between ↵Marcus Shawcroft2-52/+42
elf_aarch64_create_or_find_stub_sec and elfNN_aarch64_add_stub
2015-03-23[AArch64] Flip sense of erratum_835769_scan.Marcus Shawcroft2-8/+19
2015-03-23[AArch64] Drop unused argument to elf_aarch64_create_or_find_stub_secMarcus Shawcroft2-10/+11
2015-03-23[AArch64] Remove unused variable.Marcus Shawcroft2-3/+6
2015-03-23Fixup previous changelog entry.Marcus Shawcroft1-1/+2
2015-03-23Remove dead code.Marcus Shawcroft2-16/+6
2015-03-23[AArch64] Tidy up in aarch64_mem_op_p().Marcus Shawcroft2-19/+31
2015-03-23[AArch64] Adjust layout of elfNN_aarch64_write_section.Marcus Shawcroft2-1/+5
2015-03-23Automatic date update in version.inGDB Administrator1-1/+1
2015-03-22Automatic date update in version.inGDB Administrator1-1/+1
2015-03-21Automatic date update in version.inGDB Administrator1-1/+1
2015-03-20Automatic date update in version.inGDB Administrator1-1/+1
2015-03-19Add support for G13 and G14 flag bits in RL78 ELF binaries.Nick Clifton2-29/+72
inc * rl78.h (E_FLAG_RL78_G10): Redefine. (E_FLAG_RL78_CPU_MASK, E_FLAG_RL78_ANY_CPU, E_FLAG_RL78_G13 E_FLAG_RL78_G14): New flags. bin * readelf.c (get_machine_flags): Decode RL78's G13 and G14 flags. gas * config/tc-rl78.c (enum options): Add G13 and G14. (md_longopts): Add -mg13 and -mg14. (md_parse_option): Handle -mg13 and -mg14. (md_show_usage): List -mg13 and -mg14. * doc/c-rl78.texi: Add description of -mg13 and -mg14 options. bfd * elf32-rl78.c (rl78_cpu_name): New function. Prints the name of the RL78 core based upon the flags. (rl78_elf_merge_private_bfd_data): Handle merging of G13 and G14 flags. (rl78_elf_print_private_bfd_data): Use rl78_cpu_name. (elf32_rl78_machine): Always return bfd_mach_rl78.
2015-03-19Fix building and testing dwarf debug section compression feature when zlib ↵Nick Clifton2-6/+7
is not available. PR gas/18087 gas/test * gas/i386/dw2-compress-1.d: Allow the test to pass regardless of whether the .debug_info section was compressed on not. bfd * compress.c (bfd_compress_section_contents): Do not define this function if it is not used.
2015-03-19Automatic date update in version.inGDB Administrator1-1/+1
2015-03-18Make bfd_compress_section_contents staticH.J. Lu3-24/+13
* compress.c (bfd_compress_section_contents): Make it static. * bfd/bfd-in2.h: Regenerated.
2015-03-18Fixes a problem generating relocs for import libraries created by Microsoft ↵Nick Clifton2-0/+15
tools for the x85_64 architecture. PR ld/16598 * peicode.h (pe_ILF_build_a_bfd): Add support for creating relocs suitable for the AMD64.
2015-03-18Fix debug section compression so that it is only performed if it would make ↵Jon Turney4-19/+50
the section smaller. PR binutils/18087 gas * doc/as.texinfo: Note that when gas compresses debug sections the compression is only performed if it makes the section smaller. * write.c (compress_debug): Do not compress a debug section if doing so would make it larger. tests * gas/i386/dw2-compress-1.d: Do not expect the .debug_abbrev or .debug_info sections to be compressed. binu * doc/binutils.texi: Note that when objcopy compresses debug sections the compression is only performed if it makes the section smaller. bfd * coffgen.c (make_a_section_from_file): Only prepend a z to a debug section's name if the section was actually compressed. * elf.c (_bfd_elf_make_section_from_shdr): Likewise. * compress.c (bfd_init_section_compress_status): Do not compress the section if doing so would make it bigger. In such cases leave the section alone and return COMPRESS_SECTION_NONE.
2015-03-18Automatic date update in version.inGDB Administrator1-1/+1
2015-03-17Fix elf64-ppc.c electric fence warningAlan Modra2-5/+16
* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return count of 0 on nothing to do, before malloc of returned symbol array.