@@ -10,7 +10,7 @@ OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)'
OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};"
OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};"
OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};"
-OTHER_SECTIONS='
+OTHER_SECTIONS="
.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
/* This section contains data that is not initialised during load
*or* application reset. */
@@ -18,11 +18,21 @@ OTHER_SECTIONS='
{
. = ALIGN(2);
PROVIDE (__noinit_start = .);
- *(.noinit)
+ *(.noinit${RELOCATING+ .noinit.* .gnu.linkonce.n.*})
. = ALIGN(2);
PROVIDE (__noinit_end = .);
}
-'
+/* This section contains data that *is* initialized during load,
+ but *not* during application reset. */
+ .persistent :
+ {
+ . = ALIGN(2);
+ PROVIDE (__persistent_start = .);
+ *(.persistent${RELOCATING+ .persistent.* .gnu.linkonce.p.*})
+ . = ALIGN(2);
+ PROVIDE (__persistent_end = .);
+ }
+"
ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'
OTHER_READONLY_SECTIONS="
.ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) }
new file mode 100644
@@ -0,0 +1,11 @@
+#name: .noinit and .persistent sections
+#ld: --orphan-handling=warn -e _start
+#source: noinit-sections.s
+#target: arm-*-* msp430-*-elf
+#readelf: -SW
+
+#...
+ +\[ *[0-9]+\] \.noinit +NOBITS +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +00 +WA .*
+#...
+ +\[ *[0-9]+\] \.persistent +PROGBITS +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +00 +WA .*
+#pass
new file mode 100644
@@ -0,0 +1,12 @@
+#name: .noinit and .persistent sections (ld -r)
+#ld: --orphan-handling=warn -e _start -r
+#source: noinit-sections.s
+#target: arm-*-* msp430-*-elf
+#readelf: -SW
+#warning_output: noinit-sections-2.l
+
+#...
+ +\[ *[0-9]+\] \.noinit +NOBITS +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +00 +WA .*
+#...
+ +\[ *[0-9]+\] \.persistent +PROGBITS +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +00 +WA .*
+#pass
new file mode 100644
@@ -0,0 +1,5 @@
+#...
+[^:]*: warning: orphan section `.noinit.var_noinit' from \S+ being placed in section `.noinit.var_noinit'
+#...
+[^:]*: warning: orphan section `.persistent.var_persistent' from \S+ being placed in section `.persistent.var_persistent'
+#pass
new file mode 100644
@@ -0,0 +1,16 @@
+.section .noinit,"aw",%nobits
+.word 0
+
+.section .noinit.var_noinit,"aw",%nobits
+.word 0
+
+.section .persistent,"aw"
+.word 1
+
+.section .persistent.var_persistent,"aw"
+.word 2
+
+.text
+.global _start
+_start:
+.word 0