ld: pru: Fix resource_table output section alignment
[binutils-gdb.git] / ld / scripttempl / sh.sc
index 036dd216db2f3cb837c39b880d17c22a4c5d04c2..47385af7c73428c92e2f5983605052eb5df17a99 100644 (file)
@@ -1,3 +1,9 @@
+# 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.
+
 TORS=".tors :
   {
     ___ctors = . ;
@@ -6,17 +12,29 @@ TORS=".tors :
     ___dtors = . ;
     *(.dtors)
     ___dtors_end = . ;
-  } > ram"
+  }${RELOCATING+ > ram}"
 
 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
 {
   ram : o = 0x1000, l = 512k
 }
 
+EOF
+
+cat <<EOF
 SECTIONS
 {
   .text :
@@ -29,6 +47,11 @@ SECTIONS
   .data :
   {
     *(.data)
+    ${RELOCATING+*(.gcc_exc*)}
+    ${RELOCATING+___EH_FRAME_BEGIN__ = . ;}
+    ${RELOCATING+*(.eh_fram*)}
+    ${RELOCATING+___EH_FRAME_END__ = . ;}
+    ${RELOCATING+LONG(0);}
     ${RELOCATING+ _edata = . ; }
   } ${RELOCATING+ > ram}
   .bss :