Skip to content

Commit afba616

Browse files
jonathonpenixnashif
authored andcommitted
arm64: linker: lld: Handle symtab/strtab/shstrtab to fix warnings
lld will produce warnings for the symtab, strtab, and shstrtab sections if --orphan-handling=warn is specified and there are no matching rules in the linker script for these sections. Handle these sections when building with lld to prevent the warnings. Signed-off-by: Jonathon Penix <[email protected]>
1 parent 9f867a1 commit afba616

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/zephyr/arch/arm64/scripts/linker.ld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,15 @@ SECTIONS
339339

340340
/DISCARD/ : { *(.note.GNU-stack) }
341341

342+
/* Output section descriptions are needed for these sections to suppress
343+
* warnings when "--orphan-handling=warn" is set for lld.
344+
*/
345+
#if defined(CONFIG_LLVM_USE_LLD)
346+
SECTION_PROLOGUE(.symtab, 0,) { *(.symtab) }
347+
SECTION_PROLOGUE(.strtab, 0,) { *(.strtab) }
348+
SECTION_PROLOGUE(.shstrtab, 0,) { *(.shstrtab) }
349+
#endif
350+
342351
/* Sections generated from 'zephyr,memory-region' nodes */
343352
LINKER_DT_SECTIONS()
344353

0 commit comments

Comments
 (0)