This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: objcopy --add-gnu-debuglink and relocatable files
On Sat, Jul 07, 2007 at 07:22:46PM -0400, Mike Frysinger wrote:
> * scripttempl/elf.sc: Discard .gnu_debuglink.
Applying this one instead.
* scripttempl/elf.sc (DISCARDED): Renamed from STACKNOTE. Add
.gnu.debuglink.
* scripttempl/armbpabi.sc: Likewise.
* scripttempl/elf32sh-symbian.sc: Likewise.
* scripttempl/elfxtensa.sc: Likewise.
* scripttempl/mep.sc: Likewise.
Index: ld/scripttempl/elf.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elf.sc,v
retrieving revision 1.81
diff -u -p -r1.81 elf.sc
--- ld/scripttempl/elf.sc 29 Jun 2007 16:29:17 -0000 1.81
+++ ld/scripttempl/elf.sc 10 Jul 2007 04:47:41 -0000
@@ -124,7 +124,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.*) }"
-STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
+DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }"
if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss ${RELOCATING-0} :
{
@@ -518,6 +518,6 @@ cat <<EOF
${ATTRS_SECTIONS}
${OTHER_SECTIONS}
${RELOCATING+${OTHER_SYMBOLS}}
- ${RELOCATING+${STACKNOTE}}
+ ${RELOCATING+${DISCARDED}}
}
EOF
Index: ld/scripttempl/armbpabi.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/armbpabi.sc,v
retrieving revision 1.12
diff -u -p -r1.12 armbpabi.sc
--- ld/scripttempl/armbpabi.sc 28 Aug 2006 01:52:56 -0000 1.12
+++ ld/scripttempl/armbpabi.sc 10 Jul 2007 04:47:40 -0000
@@ -30,7 +30,7 @@ INTERP=".interp 0 : { *(.interp) }
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }"
-STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
+DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }"
if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss ${RELOCATING-0} :
{
@@ -360,7 +360,7 @@ cat <<EOF
${STACK_ADDR+${STACK}}
${OTHER_SECTIONS}
${RELOCATING+${OTHER_SYMBOLS}}
- ${RELOCATING+${STACKNOTE}}
+ ${RELOCATING+${DISCARDED}}
EOF
# These relocations sections are part of the read-only segment in SVR4
Index: ld/scripttempl/elf32sh-symbian.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elf32sh-symbian.sc,v
retrieving revision 1.7
diff -u -p -r1.7 elf32sh-symbian.sc
--- ld/scripttempl/elf32sh-symbian.sc 29 Jun 2007 16:29:17 -0000 1.7
+++ ld/scripttempl/elf32sh-symbian.sc 10 Jul 2007 04:47:41 -0000
@@ -83,7 +83,7 @@ fi
PLT=".plt : { *(.plt) } :dynamic :dyn"
DYNAMIC=".dynamic : { *(.dynamic) } :dynamic :dyn"
RODATA=".rodata ALIGN(4) : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
-STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) *(.directive) }"
+DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.directive) }"
test -z "$GOT" && GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) } :dynamic :dyn"
CTOR=".ctors ALIGN(4) :
{
@@ -380,6 +380,6 @@ cat <<EOF
${ATTRS_SECTIONS}
${OTHER_SECTIONS}
${RELOCATING+${OTHER_SYMBOLS}}
- ${RELOCATING+${STACKNOTE}}
+ ${RELOCATING+${DISCARDED}}
}
EOF
Index: ld/scripttempl/elfxtensa.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elfxtensa.sc,v
retrieving revision 1.13
diff -u -p -r1.13 elfxtensa.sc
--- ld/scripttempl/elfxtensa.sc 29 Jun 2007 16:29:17 -0000 1.13
+++ ld/scripttempl/elfxtensa.sc 10 Jul 2007 04:47:41 -0000
@@ -137,7 +137,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.*) }"
-STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
+DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }"
INIT_LIT=".init.literal 0 : { *(.init.literal) }"
INIT=".init 0 : { *(.init) }"
FINI_LIT=".fini.literal 0 : { *(.fini.literal) }"
@@ -538,6 +538,6 @@ cat <<EOF
${ATTRS_SECTIONS}
${OTHER_SECTIONS}
${RELOCATING+${OTHER_SYMBOLS}}
- ${RELOCATING+${STACKNOTE}}
+ ${RELOCATING+${DISCARDED}}
}
EOF
Index: ld/scripttempl/mep.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/mep.sc,v
retrieving revision 1.1
diff -u -p -r1.1 mep.sc
--- ld/scripttempl/mep.sc 5 Feb 2007 20:16:32 -0000 1.1
+++ ld/scripttempl/mep.sc 10 Jul 2007 04:47:41 -0000
@@ -114,7 +114,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) *(.data.rel.ro*) }"
-STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
+DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }"
if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss ${RELOCATING-0} :
{
@@ -441,6 +441,6 @@ cat <<EOF
${STACK_ADDR+${STACK}}
${OTHER_SECTIONS}
${RELOCATING+${OTHER_END_SYMBOLS}}
- ${RELOCATING+${STACKNOTE}}
+ ${RELOCATING+${DISCARDED}}
}
EOF
--
Alan Modra
Australia Development Lab, IBM