[binutils-gdb] [PATCH 1/2] coff-go32: update ldscript

Nick Clifton nickc@sourceware.org
Fri Apr 17 12:12:57 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0fe0f2d6215295ef882022fb7ae345f71738e682

commit 0fe0f2d6215295ef882022fb7ae345f71738e682
Author: Juan Manuel Guerrero <juan.guerrero@gmx.de>
Date:   Fri Apr 17 13:12:31 2020 +0100

    [PATCH 1/2] coff-go32: update ldscript
    
            * scripttempl/i386go32.sc: Provide symbol _environ.  Link in
            .ctors and .dtors.  Discard LTO sections.

Diff:
---
 ld/ChangeLog               |  6 ++++++
 ld/scripttempl/i386go32.sc | 12 ++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9a32c899c2d..8e3e2df3e8c 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2020-04-17  Juan Manuel Guerrero  <juan.guerrero@gmx.de>
+            Jan W. Jagersma  <jwjagersma@gmail.com>
+
+	* scripttempl/i386go32.sc: Provide symbol _environ.  Link in
+	.ctors and .dtors.  Discard LTO sections.
+
 2020-04-17  Nick Clifton  <nickc@redhat.com>
 
 	* testsuite/config/default.exp: If not already set then create the
diff --git a/ld/scripttempl/i386go32.sc b/ld/scripttempl/i386go32.sc
index 999aa0527dc..60171fc846c 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) }


More information about the Binutils-cvs mailing list