zephyr/include/linker/rel-sections.ld
Daniel Leung 6600c64331 linker: warn about orphan sections
(Previous patch set was reverted due to issue with priv_stack.
 Resubmitting after fixing the faults caused by priv_stack.noinit
 not at the end of RAM.)

This adds a linker flag and necessary changes to linker scripts
so that linker will warn about orphan sections.

Relates to #5534.

Fixes #10473, #10474, #10515.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-10-19 16:11:34 -04:00

33 lines
545 B
Text

/*
* .rel.* are for relocation.
* These are being produced by compiler/linker.
* Specify these here so they are not considered orphan sections.
*/
SECTION_PROLOGUE(.rel.plt,,)
{
*(.rel.plt)
PROVIDE_HIDDEN (__rel_iplt_start = .);
*(.rel.iplt)
PROVIDE_HIDDEN (__rel_iplt_end = .);
}
SECTION_PROLOGUE(.rela.plt,,)
{
*(.rela.plt)
PROVIDE_HIDDEN (__rela_iplt_start = .);
*(.rela.iplt)
PROVIDE_HIDDEN (__rela_iplt_end = .);
}
SECTION_PROLOGUE(.rel.dyn,,)
{
*(.rel.*)
}
SECTION_PROLOGUE(.rela.dyn,,)
{
*(.rela.*)
}