[PATCH] ARM: Support .noinit and .persistent sections in ELF linker script

Nick Clifton nickc@redhat.com
Wed Nov 25 12:36:25 GMT 2020


Hi Jozef,

>>> Support for the "persistent" attribute, to place variables in the
>>> ".persistent" section, has been added to GCC and needs to be handled in
>>> the default ARM ELF linker script.

>> Are these sections ARM specific ?

> The sections are not ARM-specific, GCC supports the corresponding
> "persistent" and "noinit" attributes for all ELF targets. In the real
> world, the sections must be placed in some non-volatile type of
> writeable memory, so may not be supported for some targets.
> 
> In addition to ARM, it looks like AVR, ARC, MSP430, and PRU already
> support a .noinit section in their default linker scripts.
> .persistent is only used by MSP430 so far.
> 
> So I could move the definitions to elf.sc, as long as it would not be
> considered intrusive for targets using elf.sc as a base, but don't
> support .noinit or .persistent.
> 
> I would also then need to remove the corresponding .noinit output
> section from the above targets using elf.sc as a base linker script, so
> there aren't duplicate definitions of that output section.

If you are willing to take on this additional work and make this
change then I think that it would be a good idea.  Having generic
support for a feature used by more than a few targets makes sense
to me.  Plus cleaning up duplicated code is always useful.

Cheers
   Nick



More information about the Binutils mailing list