aboutsummaryrefslogtreecommitdiff
path: root/ld/scripttempl
diff options
context:
space:
mode:
authorJuan Manuel Guerrero <juan.guerrero@gmx.de>2020-04-17 13:12:31 +0100
committerNick Clifton <nickc@redhat.com>2020-04-17 13:12:31 +0100
commit0fe0f2d6215295ef882022fb7ae345f71738e682 (patch)
treee097fd77004d23f5faf88f4cd9de9467112dccdc /ld/scripttempl
parent49c16254b41d56c35ce788eae76a1c1bc22db7ac (diff)
downloadgdb-0fe0f2d6215295ef882022fb7ae345f71738e682.zip
gdb-0fe0f2d6215295ef882022fb7ae345f71738e682.tar.gz
gdb-0fe0f2d6215295ef882022fb7ae345f71738e682.tar.bz2
[PATCH 1/2] coff-go32: update ldscript
* scripttempl/i386go32.sc: Provide symbol _environ. Link in .ctors and .dtors. Discard LTO sections.
Diffstat (limited to 'ld/scripttempl')
-rw-r--r--ld/scripttempl/i386go32.sc12
1 files changed, 12 insertions, 0 deletions
diff --git a/ld/scripttempl/i386go32.sc b/ld/scripttempl/i386go32.sc
index 999aa05..60171fc 100644
--- a/ld/scripttempl/i386go32.sc
+++ b/ld/scripttempl/i386go32.sc
@@ -43,15 +43,21 @@ SECTIONS
${RELOCATING+etext = . ; PROVIDE(_etext = .) ;}
${RELOCATING+. = ALIGN(${SEGMENT_SIZE});}
}
+
.data ${RELOCATING+ ${DATA_ALIGNMENT}} : {
${RELOCATING+djgpp_first_ctor = . ;
*(SORT(.ctors.*))
*(.ctor)
+ *(.ctors)
djgpp_last_ctor = . ;}
${RELOCATING+djgpp_first_dtor = . ;
*(SORT(.dtors.*))
*(.dtor)
+ *(.dtors)
djgpp_last_dtor = . ;}
+ __environ = . ;
+ PROVIDE(_environ = .) ;
+ LONG(0) ;
*(.data)
${RELOCATING+*(.data.*)}
@@ -65,8 +71,10 @@ SECTIONS
${RELOCATING+edata = . ; PROVIDE(_edata = .) ;}
${RELOCATING+. = ALIGN(${SEGMENT_SIZE});}
}
+
${CONSTRUCTING+${RELOCATING-$CTOR}}
${CONSTRUCTING+${RELOCATING-$DTOR}}
+
.bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
{
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
@@ -74,6 +82,10 @@ SECTIONS
${RELOCATING+ end = . ; PROVIDE(_end = .) ;}
${RELOCATING+ . = ALIGN(${SEGMENT_SIZE});}
}
+
+ /* Discard LTO sections. */
+ /DISCARD/ : { *(.gnu.lto_*) }
+
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }