This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Drop sections with .gnu.lto_ prefix on ELF targets when relocating


This implements support for GCC link-time optimization where GCC places
internal representation of the program in .gnu.lto_ prefixed sections.
When linking these section should be dropped.  Gold already does that,
the following patch implements it for GNU ld.

Built and tested on x86_64-unknown-linux-gnu, built and tested on
{x86_64,i686,ppc,ppc64,s390,s390x,ia64}-linux-gnu ontop a slightly
older snapshot.

Please someone commit this for me if it is approved, I do not have
write access to src.

Thanks,
Richard.

2009-08-20  Richard Guenther  <rguenther@suse.de>

	* scripttempl/elf.sc: Discard sections with .gnu.lto_ prefix.

Index: ld/scripttempl/elf.sc
===================================================================
--- ld/scripttempl/elf.sc.orig	2009-01-16 15:14:06.000000000 +0100
+++ ld/scripttempl/elf.sc	2009-08-20 11:18:16.000000000 +0200
@@ -127,7 +127,7 @@ fi
 DYNAMIC=".dynamic      ${RELOCATING-0} : { *(.dynamic) }"
 RODATA=".rodata       ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
 DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }"
-DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }"
+DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }"
 if test -z "${NO_SMALL_DATA}"; then
   SBSS=".sbss         ${RELOCATING-0} :
   {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]