From 7f0cd6692b7eadd937e9fbd6a13bce7e7f4ec44c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 11 Apr 2025 15:09:00 -0700 Subject: [PATCH] soc: andestech: linker.ld: 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. This is exactly the same as commit c420733c335a10f71cef888dfc80640349c611dd, but for the AE350 linker script. Signed-off-by: Tom Hughes --- soc/andestech/ae350/linker.ld | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/soc/andestech/ae350/linker.ld b/soc/andestech/ae350/linker.ld index 4c94c705212..ae10cab3ccd 100644 --- a/soc/andestech/ae350/linker.ld +++ b/soc/andestech/ae350/linker.ld @@ -405,6 +405,15 @@ GROUP_END(DTCM) KEEP(*(.gnu.attributes)) } +/* Output section descriptions are needed for these sections to suppress + * warnings when "--orphan-handling=warn" is set for lld. + */ +#if defined(CONFIG_LLVM_USE_LLD) + SECTION_PROLOGUE(.symtab, 0,) { *(.symtab) } + SECTION_PROLOGUE(.strtab, 0,) { *(.strtab) } + SECTION_PROLOGUE(.shstrtab, 0,) { *(.shstrtab) } +#endif + /* Sections generated from 'zephyr,memory-region' nodes */ LINKER_DT_SECTIONS()