Commit Graph

11791 Commits

Author SHA1 Message Date
Senthil Kumar Selvaraj
d422d1c433 Garbage collecting debug sections
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-25 20:42:00 +10:30
GDB Administrator
f6d5c6943b Automatic date update in version.in 2015-03-25 00:00:08 +00:00
H.J. Lu
8d00121477 Don't write the zlib header if not used
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-24 13:27:52 -07:00
Nick Clifton
fc42baf3cd Fixes a bug introduced by the new ranges checks on COFF symbol tables.
PR binutils/17512
	* coffgen.c (coff_get_normalized_symtab): Fix test for out of
	range auxillary sections.
2015-03-24 17:20:00 +00:00
Marcus Shawcroft
fc6d53be18 [AArch64] Factor out _bfd_aarch64_get_stub_for_link_section. 2015-03-24 14:10:43 +00:00
Marcus Shawcroft
30068a6d2d [AArch64] Refactor section_group[] representation.
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 14:10:43 +00:00
Marcus Shawcroft
5421cc6e55 [AArch64] Refactor generation of 835769 workaround stubs.
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 12:03:46 +00:00
Marcus Shawcroft
e572930b96 [AArch64] Use _bfd_aarch64_add_stub_entry_in_group.
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-24 12:03:39 +00:00
Alan Modra
8131c12209 Make powerpc bfd ld reloc overflow vs undefined symbols match gold
* 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-24 17:42:36 +10:30
GDB Administrator
9993d01233 Automatic date update in version.in 2015-03-24 00:00:08 +00:00
Keith Seitz
c53ed7cf57 [OBV] Fix build -- missing ';'
bfd/ChangeLog

	* elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Add
	missing ';'.
2015-03-23 11:47:26 -07:00
Marcus Shawcroft
94a75bde2f Adding Changelog for previous commit. 2015-03-23 16:56:29 +00:00
Marcus Shawcroft
35fee8b77b Factor out _bfd_aarch64_erratum_835769_stub_name 2015-03-23 16:14:14 +00:00
Marcus Shawcroft
13f622ec59 [AArch64] Factor out _bfd_aarch64_resize_stubs() 2015-03-23 16:14:05 +00:00
Marcus Shawcroft
6658567565 [AArch64] Factor stub creation code into _bfd_aarch64_create_stub_section. 2015-03-23 16:06:55 +00:00
Marcus Shawcroft
ef85752125 [AArch64] Factor out common behaviour between elf_aarch64_create_or_find_stub_sec and elfNN_aarch64_add_stub 2015-03-23 15:52:03 +00:00
Marcus Shawcroft
2144188dcf [AArch64] Flip sense of erratum_835769_scan. 2015-03-23 15:44:08 +00:00
Marcus Shawcroft
4c77202d00 [AArch64] Drop unused argument to elf_aarch64_create_or_find_stub_sec 2015-03-23 15:20:30 +00:00
Marcus Shawcroft
9b9971aac7 [AArch64] Remove unused variable. 2015-03-23 15:20:30 +00:00
Marcus Shawcroft
23956543da Fixup previous changelog entry. 2015-03-23 15:11:45 +00:00
Marcus Shawcroft
e2cdef47b7 Remove dead code. 2015-03-23 14:46:04 +00:00
Marcus Shawcroft
3d14faea41 [AArch64] Tidy up in aarch64_mem_op_p(). 2015-03-23 14:45:37 +00:00
Marcus Shawcroft
f872121a87 [AArch64] Adjust layout of elfNN_aarch64_write_section. 2015-03-23 14:35:28 +00:00
GDB Administrator
1a504d0763 Automatic date update in version.in 2015-03-23 00:00:08 +00:00
GDB Administrator
7188340681 Automatic date update in version.in 2015-03-22 00:00:08 +00:00
GDB Administrator
5da7e675cd Automatic date update in version.in 2015-03-21 00:00:07 +00:00
GDB Administrator
d4828b9e88 Automatic date update in version.in 2015-03-20 00:00:07 +00:00
Nick Clifton
1740ba0cec Add support for G13 and G14 flag bits in RL78 ELF binaries.
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-19 15:37:43 +00:00
Nick Clifton
e2575e05e7 Fix building and testing dwarf debug section compression feature when zlib 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-19 12:14:56 +00:00
GDB Administrator
590d1e9a30 Automatic date update in version.in 2015-03-19 00:00:07 +00:00
H.J. Lu
0b0732e13a Make bfd_compress_section_contents static
* compress.c (bfd_compress_section_contents): Make it static.
	* bfd/bfd-in2.h: Regenerated.
2015-03-18 11:20:06 -07:00
Nick Clifton
27aaeda0cd Fixes a problem generating relocs for import libraries created by Microsoft 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-18 16:19:59 +00:00
Jon Turney
273a49858f Fix debug section compression so that it is only performed if it would make 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-18 15:47:13 +00:00
GDB Administrator
641754af2b Automatic date update in version.in 2015-03-18 00:00:08 +00:00
Alan Modra
c4b0b099b8 Fix elf64-ppc.c electric fence warning
* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return count of 0
	on nothing to do, before malloc of returned symbol array.
2015-03-17 13:41:01 +10:30
GDB Administrator
4d22acce07 Automatic date update in version.in 2015-03-17 00:00:08 +00:00
Nick Clifton
9c761a5541 Fixes a problem with the RX port trying to perform linker relaxation when -no-keep-memory has been enabled.
* elf32-rx.c (elf32_rx_relax_delete_bytes): If the relocs are not
	stored in the elf_section_data structure then load them as
	necessary.
2015-03-16 11:14:07 +00:00
GDB Administrator
a4f851ffab Automatic date update in version.in 2015-03-16 00:00:08 +00:00
GDB Administrator
c2cdb853dc Automatic date update in version.in 2015-03-15 00:00:07 +00:00
Andreas Krebbel
b9005ba76e S/390: Disable relocation sort against code sections.
When downgrading from GD to IE model we rewrite the call to
__tls_get_offset to a 64 bit load instruction. This relies on the fact
that the additional relocation for the call target has already been
executed when doing the rewrite.

   f1018:       e3 20 d0 00 00 04       lg      %r2,0(%r13)
   f101e:       c0 e5 00 00 00 00       brasl   %r14,f101e <__res_init+0x1e>
                        f101e: R_390_TLS_GDCALL __libc_resp
                        f1020: R_390_PLT32DBL   __tls_get_offset+0x2

0000000f1020  39f6c00000014 R_390_PLT32DBL    0000000000000000 __tls_get_offset + 2
0000000f101e  3afb700000026 R_390_TLS_GDCALL  0000000000000008 __libc_resp + 0

Due to the reloc sorting the order changed an the PLT32DBL reloc is
executed after the rewrite and overwrites part of the load instruction
with garbage.

bfd/
2015-03-14  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* elf-s390-common.c (elf_s390_elf_sort_relocs_p): Don't sort
	relocs against code sections.
	* elf32-s390.c: Define elf_backend_sort_relocs_p.
	* elf64-s390.c: Likewise.
2015-03-14 11:45:05 +01:00
GDB Administrator
e94dfb0747 Automatic date update in version.in 2015-03-14 00:00:08 +00:00
GDB Administrator
a1894d4393 Automatic date update in version.in 2015-03-13 00:00:07 +00:00
GDB Administrator
9773715938 Automatic date update in version.in 2015-03-12 00:00:07 +00:00
Alan Modra
1079403cc0 Fix ppc32 synthetic symbols when __tls_get_addr_opt stub is generated
Also update the 32-bit tls testcases to be secure plt.

bfd/
	* elf32-ppc.c (ppc_elf_get_synthetic_symtab): Examine stubs in
	reverse order.  Account for larger size of __tls_get_addr_opt stub.
ld/testsuite/
	* ld-powerpc/tls32.s: Add GOT pointer setup.
	* ld-powerpc/tls32.d: Update.
	* ld-powerpc/tls32.g: Update.
	* ld-powerpc/tls32.t: Update.
	* ld-powerpc/tlsexe.d: Update.
	* ld-powerpc/tlsexe32.d: Update.
	* ld-powerpc/tlsexe32.g: Update.
	* ld-powerpc/tlsexe32.r: Update.
	* ld-powerpc/tlsexetoc.d: Update.
	* ld-powerpc/tlsso32.d: Update.
	* ld-powerpc/tlsso32.g: Update.
	* ld-powerpc/tlsso32.r: Update.
2015-03-11 18:04:25 +10:30
GDB Administrator
796ecec4cf Automatic date update in version.in 2015-03-11 00:00:07 +00:00
Jiong Wang
a5721eddd1 [ARM] PR ld/16572: Remove EF_ARM_HASENTRY flag
bfd/
2015-03-10  Yuri Gribov  <y.gribov@samsung.arm>

	PR ld/16572
	* elf32-arm.c (elf32_arm_final_link_relocate): Remove
	support for ELF_ARM_HASENTRY.
	(elf32_arm_print_private_bfd_data): Likewise.

binutils/
2015-03-10  Yuri Gribov  <y.gribov@samsung.arm>

	PR ld/16572
	* readelf.c: Remove support for ELF_ARM_HASENTRY.

include/
2015-03-10  Matthew Wahab  <matthew.wahab@arm.com>

	PR ld/16572
	* elf/arm.h (EF_ARM_HASENTRY): Remove.
2015-03-10 11:15:13 +00:00
GDB Administrator
a24582147f Automatic date update in version.in 2015-03-10 00:00:08 +00:00
GDB Administrator
ccf946cb5c Automatic date update in version.in 2015-03-09 00:00:08 +00:00
GDB Administrator
d1771b7685 Automatic date update in version.in 2015-03-08 00:00:08 +00:00
GDB Administrator
f6162ff58e Automatic date update in version.in 2015-03-07 00:00:08 +00:00