Merge branch 'master' into merge-job
[deliverable/binutils-gdb.git] / ld / scripttempl / elfd30v.sc
index 12d764f285e023ea42e02894267f3f61cfde456e..a403bc31b35cec1e5d08e584653797674284f0a0 100644 (file)
@@ -1,5 +1,10 @@
+# Copyright (C) 2014-2020 Free Software Foundation, Inc.
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.
 
-CTOR=".ctors ${CONSTRUCTING-0} : 
+CTOR=".ctors ${CONSTRUCTING-0} :
   {
     ${CONSTRUCTING+ __CTOR_LIST__ = .; }
     /* gcc uses crtbegin.o to find the start of
@@ -12,14 +17,15 @@ CTOR=".ctors ${CONSTRUCTING-0} :
        doesn't matter which directory crtbegin.o
        is in.  */
 
-    KEEP (*crtbegin*.o(.ctors))
+    KEEP (*crtbegin.o(.ctors))
+    KEEP (*crtbegin?.o(.ctors))
 
     /* We don't want to include the .ctor section from
-       from the crtend.o file until after the sorted ctors.
+       the crtend.o file until after the sorted ctors.
        The .ctor section from the crtend file contains the
        end of ctors marker and it must be last */
 
-    KEEP (*(EXCLUDE_FILE (*crtend*.o) .ctors))
+    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o) .ctors))
     KEEP (*(SORT(.ctors.*)))
     KEEP (*(.ctors))
     ${CONSTRUCTING+ __CTOR_END__ = .; }
@@ -28,17 +34,27 @@ CTOR=".ctors ${CONSTRUCTING-0} :
 DTOR="  .dtors ${CONSTRUCTING-0} :
   {
     ${CONSTRUCTING+ __DTOR_LIST__ = .; }
-    KEEP (*crtbegin*.o(.dtors))
-    KEEP (*(EXCLUDE_FILE (*crtend*.o) .dtors))
+    KEEP (*crtbegin.o(.dtors))
+    KEEP (*crtbegin?.o(.dtors))
+    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o) .dtors))
     KEEP (*(SORT(.dtors.*)))
     KEEP (*(.dtors))
     ${CONSTRUCTING+ __DTOR_END__ = .; }
   } ${RELOCATING+ > ${DATA_MEMORY}}"
 
 cat <<EOF
+/* Copyright (C) 2014-2020 Free Software Foundation, Inc.
+
+   Copying and distribution of this script, with or without modification,
+   are permitted in any medium without royalty provided the copyright
+   notice and this notice are preserved.  */
+
 OUTPUT_FORMAT("${OUTPUT_FORMAT}")
 OUTPUT_ARCH(${ARCH})
 
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
 MEMORY
 {
   text ${TEXT_DEF_SECTION} : ORIGIN = ${TEXT_START_ADDR}, LENGTH = ${TEXT_SIZE}
@@ -47,6 +63,9 @@ MEMORY
   eit                     : ORIGIN = ${EIT_START_ADDR},  LENGTH = ${EIT_SIZE}
 }
 
+EOF
+
+cat <<EOF
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
@@ -58,12 +77,12 @@ SECTIONS
   .gnu.version_d       ${RELOCATING-0} : { *(.gnu.version_d) }
   .gnu.version_r       ${RELOCATING-0} : { *(.gnu.version_r) }
 
-  .rel.text            ${RELOCATING-0} : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
-  .rela.text           ${RELOCATING-0} : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
-  .rel.data            ${RELOCATING-0} : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
-  .rela.data           ${RELOCATING-0} : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
-  .rel.rodata          ${RELOCATING-0} : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
-  .rela.rodata         ${RELOCATING-0} : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
+  .rel.text            ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.gnu.linkonce.t*}) }
+  .rela.text           ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.gnu.linkonce.t*}) }
+  .rel.data            ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.gnu.linkonce.d*}) }
+  .rela.data           ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.gnu.linkonce.d*}) }
+  .rel.rodata          ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.gnu.linkonce.r*}) }
+  .rela.rodata         ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.gnu.linkonce.r*}) }
   .rel.stext           ${RELOCATING-0} : { *(.rel.stest) }
   .rela.stext          ${RELOCATING-0} : { *(.rela.stest) }
   .rel.etext           ${RELOCATING-0} : { *(.rel.etest) }
@@ -97,7 +116,7 @@ SECTIONS
   .rel.plt             ${RELOCATING-0} : { *(.rel.plt) }
   .rela.plt            ${RELOCATING-0} : { *(.rela.plt) }
 
-  .init                        ${RELOCATING-0} : { *(.init) } =${NOP-0}
+  .init                        ${RELOCATING-0} : { KEEP (*(SORT_NONE(.init))) } =${NOP-0}
   ${DATA_PLT-${PLT}}
 
   /* Internal text space */
@@ -107,10 +126,9 @@ SECTIONS
   .text :
   {
     *(.text)
-    *(.gnu.linkonce.t*)
-    *(.init)
-    *(.fini)
-    ${RELOCATING+ _etext = . ; }
+    ${RELOCATING+*(.gnu.linkonce.t*)
+    KEEP (*(SORT_NONE(.fini)))
+    _etext = . ;}
   } ${RELOCATING+ > ${TEXT_MEMORY}}
 
   /* Internal data space */
@@ -133,7 +151,7 @@ SECTIONS
   .data                ${RELOCATING-0} :
   {
     *(.data)
-    *(.gnu.linkonce.d*)
+    ${RELOCATING+*(.gnu.linkonce.d*)}
     ${CONSTRUCTING+CONSTRUCTORS}
     ${RELOCATING+ _edata = . ; }
   } ${RELOCATING+ > ${DATA_MEMORY}}
@@ -167,7 +185,7 @@ SECTIONS
   {
     ${RELOCATING+ PROVIDE (__bss_start = .) ; }
     *(.bss)
-    *(COMMON)
+    ${RELOCATING+*(COMMON)}
     ${RELOCATING+ PROVIDE (__bss_end = .) ; }
     ${RELOCATING+ _end = . ;  }
   } ${RELOCATING+ > ${DATA_MEMORY}}
@@ -189,35 +207,14 @@ SECTIONS
 
   .comment      0 : { *(.comment) }
 
-  /* DWARF debug sections.
-     Symbols in the DWARF debugging sections are relative to the beginning
-     of the section so we begin them at 0.  */
-
-  /* DWARF 1 */
-  .debug        0 : { *(.debug) }
-  .line                 0 : { *(.line) }
-
-  /* GNU DWARF 1 extensions */
-  .debug_srcinfo 0 : { *(.debug_srcinfo) }
-  .debug_sfnames 0 : { *(.debug_sfnames) }
-
-  /* DWARF 1.1 and DWARF 2 */
-  .debug_aranges  0 : { *(.debug_aranges) }
-  .debug_pubnames 0 : { *(.debug_pubnames) }
+EOF
 
-  /* DWARF 2 */
-  .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
-  .debug_abbrev   0 : { *(.debug_abbrev) }
-  .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
-  .debug_str      0 : { *(.debug_str) }
-  .debug_loc      0 : { *(.debug_loc) }
-  .debug_macinfo  0 : { *(.debug_macinfo) }
+. $srcdir/scripttempl/DWARF.sc
 
-  PROVIDE (__stack = ${STACK_START_ADDR});
+cat <<EOF
+  ${RELOCATING+PROVIDE (__stack = ${STACK_START_ADDR});}
 }
 EOF
 
 
 
-
This page took 0.027283 seconds and 4 git commands to generate.