Skip to content

Commit 7f0cd66

Browse files
thugheskartben
authored andcommitted
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 c420733, but for the AE350 linker script. Signed-off-by: Tom Hughes <[email protected]>
1 parent c5429d3 commit 7f0cd66

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

soc/andestech/ae350/linker.ld

+9
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,15 @@ GROUP_END(DTCM)
405405
KEEP(*(.gnu.attributes))
406406
}
407407

408+
/* Output section descriptions are needed for these sections to suppress
409+
* warnings when "--orphan-handling=warn" is set for lld.
410+
*/
411+
#if defined(CONFIG_LLVM_USE_LLD)
412+
SECTION_PROLOGUE(.symtab, 0,) { *(.symtab) }
413+
SECTION_PROLOGUE(.strtab, 0,) { *(.strtab) }
414+
SECTION_PROLOGUE(.shstrtab, 0,) { *(.shstrtab) }
415+
#endif
416+
408417
/* Sections generated from 'zephyr,memory-region' nodes */
409418
LINKER_DT_SECTIONS()
410419

0 commit comments

Comments
 (0)