diff mbox series

[ld,arm] Add support for noinit section

Message ID CAKdteOapoGZ5j-uo4mXn=5qOggmD5bRWhJigyWxAFE+R5byLLA@mail.gmail.com
State New
Headers show
Series [ld,arm] Add support for noinit section | expand

Commit Message

Christophe Lyon Aug. 14, 2019, 1:37 p.m. UTC
Hi,

Similar to what already exists for TI msp430 or in TI compilers for
arm, this patch adds support for the "noinit" attribute.

I've just committed the GCC patch:
https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00381.html
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=274482

This small linker patch makes sure that the noinit section has the NOLOAD flag.

OK?

Christophe
2019-08-14  Christophe Lyon  <christophe.lyon@linaro.org>

	* emulparams/armelf.sh (OTHER_SECTIONS): Add support for noinit
	section.

Comments

Nick Clifton Aug. 15, 2019, 11:34 a.m. UTC | #1
Hi Christophe,

> This small linker patch makes sure that the noinit section has the NOLOAD flag.

> 

> OK?


Approved - please apply.

Cheers
  Nick
diff mbox series

Patch

diff --git a/ld/emulparams/armelf.sh b/ld/emulparams/armelf.sh
index 272a8bc..d46e0bd 100644
--- a/ld/emulparams/armelf.sh
+++ b/ld/emulparams/armelf.sh
@@ -10,7 +10,19 @@  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='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
+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.  */
+ .noinit (NOLOAD) :
+ {
+   . = ALIGN(2);
+   PROVIDE (__noinit_start = .);
+   *(.noinit)
+   . = ALIGN(2);
+   PROVIDE (__noinit_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.*}) }