]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/scripttempl/elfd30v.sc
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / ld / scripttempl / elfd30v.sc
index 7f185a5fea182810dc06af915d41da64472b56e0..bc2cfe8d6fa67885035bc96eb937383da37e0f6c 100644 (file)
@@ -1,5 +1,10 @@
+# Copyright (C) 2014-2021 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
@@ -38,9 +43,18 @@ DTOR="  .dtors       ${CONSTRUCTING-0} :
   } ${RELOCATING+ > ${DATA_MEMORY}}"
 
 cat <<EOF
+/* Copyright (C) 2014-2021 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}
@@ -49,6 +63,9 @@ MEMORY
   eit                     : ORIGIN = ${EIT_START_ADDR},  LENGTH = ${EIT_SIZE}
 }
 
+EOF
+
+cat <<EOF
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
@@ -60,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) }
@@ -99,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 */
@@ -109,10 +126,9 @@ SECTIONS
   .text :
   {
     *(.text)
-    *(.gnu.linkonce.t*)
-    *(SORT_NONE(.init))
-    *(SORT_NONE(.fini))
-    ${RELOCATING+ _etext = . ; }
+    ${RELOCATING+*(.gnu.linkonce.t*)
+    KEEP (*(SORT_NONE(.fini)))
+    _etext = . ;}
   } ${RELOCATING+ > ${TEXT_MEMORY}}
 
   /* Internal data space */
@@ -135,7 +151,7 @@ SECTIONS
   .data                ${RELOCATING-0} :
   {
     *(.data)
-    *(.gnu.linkonce.d*)
+    ${RELOCATING+*(.gnu.linkonce.d*)}
     ${CONSTRUCTING+CONSTRUCTORS}
     ${RELOCATING+ _edata = . ; }
   } ${RELOCATING+ > ${DATA_MEMORY}}
@@ -169,7 +185,7 @@ SECTIONS
   {
     ${RELOCATING+ PROVIDE (__bss_start = .) ; }
     *(.bss)
-    *(COMMON)
+    ${RELOCATING+*(COMMON)}
     ${RELOCATING+ PROVIDE (__bss_end = .) ; }
     ${RELOCATING+ _end = . ;  }
   } ${RELOCATING+ > ${DATA_MEMORY}}
@@ -193,13 +209,12 @@ SECTIONS
 
 EOF
 
-source $srcdir/scripttempl/DWARF.sc
+. $srcdir/scripttempl/DWARF.sc
 
-cat <<EOF  
-  PROVIDE (__stack = ${STACK_START_ADDR});
+cat <<EOF
+  ${RELOCATING+PROVIDE (__stack = ${STACK_START_ADDR});}
 }
 EOF
 
 
 
-