view patches/nsis-2.46-linker_script-default.patch @ 6512:ccc20ae889ca default tip guix

mingw::guile-2.0.7 builds.
author Jan Nieuwenhuizen <janneke@gnu.org>
date Thu, 24 Mar 2016 08:03:39 +0100
parents 04693165013a
children
line wrap: on
line source

The deafult linker script is acquirable by the following command.

i686-mingw32-ld --verbose

--- a/SCons/Config/linker_script	2005-08-06 00:27:58.000000000 +0900
+++ b/SCons/Config/linker_script	2014-11-16 15:15:01.302783500 +0900
@@ -1,57 +1,63 @@
+/* Default linker script, for normal executables */
 OUTPUT_FORMAT(pei-i386)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
 SECTIONS
 {
-  .text  __image_base__ + __section_alignment__  :
+  /* Make the virtual address and file offset synced if the alignment is
+     lower than the target page size. */
+  . = SIZEOF_HEADERS;
+  . = ALIGN(__section_alignment__);
+  .text  __image_base__ + ( __section_alignment__ < 0x1000 ? . : __section_alignment__ ) :
   {
      *(.init)
     *(.text)
     *(SORT(.text$*))
+     *(.text.*)
+     *(.gnu.linkonce.t.*)
     *(.glue_7t)
     *(.glue_7)
-   	___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
-			LONG (-1);
-			*(EXCLUDE_FILE (*crtend.o) .ctors);
-			*(.ctor);
-			*(SORT(.ctors.*));
-			*crtend.o (.ctors);
-			LONG (0);
-    	___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
-			LONG (-1);
-			*(EXCLUDE_FILE (*crtend.o) .dtors);
-			*(.dtor);
-			*(SORT(.dtors.*));
-			*crtend.o (.dtors);
-			LONG (0);
+     ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
+			LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*));  LONG (0);
+     ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
+			LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*));  LONG (0);
      *(.fini)
     /* ??? Why is .gcc_exc here?  */
      *(.gcc_exc)
     PROVIDE (etext = .);
-    *(.gcc_except_table)
+    PROVIDE (_etext = .);
+     *(.gcc_except_table)
   }
   /* The Cygwin32 library uses a section to avoid copying certain data
      on fork.  This used to be named ".data".  The linker used
      to include this between __data_start__ and __data_end__, but that
      breaks building the cygwin32 dll.  Instead, we name the section
-     ".data_cygwin_nocopy" and explictly include it after __data_end__. */
+     ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
   .data BLOCK(__section_alignment__) :
   {
     __data_start__ = . ;
     *(.data)
     *(.data2)
     *(SORT(.data$*))
+    *(.jcr)
     __data_end__ = . ;
     *(.data_cygwin_nocopy)
   }
   .rdata BLOCK(__section_alignment__) :
   {
     *(.rdata)
-    *(SORT(.rdata$*))
-    *(.eh_frame)
-    ___RUNTIME_PSEUDO_RELOC_LIST__ = .;
-    __RUNTIME_PSEUDO_RELOC_LIST__ = .;
+             *(SORT(.rdata$*))
+    __rt_psrelocs_start = .;
     *(.rdata_runtime_pseudo_reloc)
-    ___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
-    __RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
+    __rt_psrelocs_end = .;
+  }
+  __rt_psrelocs_size = __rt_psrelocs_end - __rt_psrelocs_start;
+  ___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
+  __RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
+  ___RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;
+  __RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;
+  .eh_frame BLOCK(__section_alignment__) :
+  {
+    *(.eh_frame*)
   }
   .pdata BLOCK(__section_alignment__) :
   {
@@ -74,6 +80,8 @@
     *(.debug$T)
     *(.debug$F)
     *(.drectve)
+     *(.note.GNU-stack)
+     *(.gnu.lto_*)
   }
   .idata BLOCK(__section_alignment__) :
   {
@@ -84,7 +92,9 @@
     /* These zeroes mark the end of the import list.  */
     LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
     SORT(*)(.idata$4)
+    __IAT_start__ = .;
     SORT(*)(.idata$5)
+    __IAT_end__ = .;
     SORT(*)(.idata$6)
     SORT(*)(.idata$7)
   }
@@ -106,12 +116,18 @@
     *(SORT(.CRT$XT*))  /* Termination */
     ___crt_xt_end__ = . ;
   }
+  /* Windows TLS expects .tls$AAA to be at the start and .tls$ZZZ to be
+     at the end of section.  This is important because _tls_start MUST
+     be at the beginning of the section to enable SECREL32 relocations with TLS
+     data.  */
   .tls BLOCK(__section_alignment__) :
   {
     ___tls_start__ = . ;
+    *(.tls$AAA)
     *(.tls)
     *(.tls$)
     *(SORT(.tls$*))
+    *(.tls$ZZZ)
     ___tls_end__ = . ;
   }
   .endjunk BLOCK(__section_alignment__) :
@@ -121,10 +137,6 @@
     PROVIDE ( _end = .);
      __end__ = .;
   }
-  .ndata BLOCK(__section_alignment__) :
-  {
-    *(.ndata)
-  }
   .rsrc BLOCK(__section_alignment__) :
   {
     *(.rsrc)
@@ -151,60 +163,141 @@
   {
     *(.debug_aranges)
   }
+  .zdebug_aranges BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_aranges)
+  }
   .debug_pubnames BLOCK(__section_alignment__) (NOLOAD) :
   {
     *(.debug_pubnames)
   }
+  .zdebug_pubnames BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_pubnames)
+  }
+  .debug_pubtypes BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.debug_pubtypes)
+  }
+  .zdebug_pubtypes BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_pubtypes)
+  }
   /* DWARF 2.  */
   .debug_info BLOCK(__section_alignment__) (NOLOAD) :
   {
-    *(.debug_info) *(.gnu.linkonce.wi.*)
+    *(.debug_info .gnu.linkonce.wi.*)
+  }
+  .zdebug_info BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_info .zdebug.gnu.linkonce.wi.*)
   }
   .debug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
   {
     *(.debug_abbrev)
   }
+  .zdebug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_abbrev)
+  }
   .debug_line BLOCK(__section_alignment__) (NOLOAD) :
   {
     *(.debug_line)
   }
+  .zdebug_line BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_line)
+  }
   .debug_frame BLOCK(__section_alignment__) (NOLOAD) :
   {
-    *(.debug_frame)
+    *(.debug_frame*)
+  }
+  .zdebug_frame BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_frame*)
   }
   .debug_str BLOCK(__section_alignment__) (NOLOAD) :
   {
     *(.debug_str)
   }
+  .zdebug_str BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_str)
+  }
   .debug_loc BLOCK(__section_alignment__) (NOLOAD) :
   {
     *(.debug_loc)
   }
+  .zdebug_loc BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_loc)
+  }
   .debug_macinfo BLOCK(__section_alignment__) (NOLOAD) :
   {
     *(.debug_macinfo)
   }
+  .zdebug_macinfo BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_macinfo)
+  }
   /* SGI/MIPS DWARF 2 extensions.  */
   .debug_weaknames BLOCK(__section_alignment__) (NOLOAD) :
   {
     *(.debug_weaknames)
   }
+  .zdebug_weaknames BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_weaknames)
+  }
   .debug_funcnames BLOCK(__section_alignment__) (NOLOAD) :
   {
     *(.debug_funcnames)
   }
+  .zdebug_funcnames BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_funcnames)
+  }
   .debug_typenames BLOCK(__section_alignment__) (NOLOAD) :
   {
     *(.debug_typenames)
   }
+  .zdebug_typenames BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_typenames)
+  }
   .debug_varnames BLOCK(__section_alignment__) (NOLOAD) :
   {
     *(.debug_varnames)
   }
+  .zdebug_varnames BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_varnames)
+  }
+  .debug_macro BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.debug_macro)
+  }
+  .zdebug_macro BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_macro)
+  }
   /* DWARF 3.  */
   .debug_ranges BLOCK(__section_alignment__) (NOLOAD) :
   {
     *(.debug_ranges)
   }
+  .zdebug_ranges BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_ranges)
+  }
+  /* DWARF 4.  */
+  .debug_types BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.debug_types .gnu.linkonce.wt.*)
+  }
+  .zdebug_types BLOCK(__section_alignment__) (NOLOAD) :
+  {
+    *(.zdebug_types .gnu.linkonce.wt.*)
+  }
 }