linker: move last section id constant to c-code
Move creation of last section id from ld linker script LONG() usage to C code with last section attribute. The use of `LONG()` works correctly with ld but lld emits a warning because .last_section section is not allocated as there are no matching input sections and discards the `LONG()` call, meaning the last section identifier will not be present in the flash. > ld.lld: warning: ignoring memory region assignment for > non-allocatable section '.last_section' Placing the last section id in `.last_section` in C code makes lld allocate the memory for the id and thereby create the output section with the correct output. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
parent
8f2560cf3e
commit
c79c4ef9a8
8 changed files with 30 additions and 30 deletions
|
@ -421,11 +421,9 @@ GROUP_END(DTCM)
|
|||
/* Must be last in romable region */
|
||||
SECTION_PROLOGUE(.last_section,,)
|
||||
{
|
||||
#ifdef CONFIG_LINKER_LAST_SECTION_ID
|
||||
/* Fill last section with a word to ensure location counter and actual rom
|
||||
* region data usage match. */
|
||||
LONG(CONFIG_LINKER_LAST_SECTION_ID_PATTERN)
|
||||
#endif
|
||||
/* .last_section contains a fixed word to ensure location counter and actual
|
||||
* rom region data usage match when CONFIG_LINKER_LAST_SECTION_ID=y. */
|
||||
KEEP(*(.last_section))
|
||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||
|
||||
/* Because ROMABLE_REGION != RAMABLE_REGION in XIP-system, it is valid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue