linker: llext: move #ifdef CONFIG_LLEXT guard inside common file
LLEXT-related sections should only be added to the linker script when the associated CONFIG_LLEXT is enabled. This has been done by checking for this Kconfig symbol in every linker file, but this creates a lot of boilerplate for no good reason. Use the much simpler solution: move the check inside the common linker file and remove existing "#ifdef CONFIG_LLEXT" checks in all linker files. Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
This commit is contained in:
committed by
Johan Hedberg
parent
bfc69ad935
commit
947749abfc
@@ -253,10 +253,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/DISCARD/ :
|
||||
{
|
||||
|
||||
@@ -80,10 +80,7 @@ MEMORY {
|
||||
SECTIONS {
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
GROUP_START(ROMABLE_REGION)
|
||||
|
||||
|
||||
@@ -97,10 +97,7 @@ ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
SECTIONS
|
||||
{
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* .plt and .iplt are here according to 'arm-zephyr-elf-ld --verbose',
|
||||
|
||||
@@ -101,10 +101,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* .plt and .iplt are here according to 'arm-zephyr-elf-ld --verbose',
|
||||
|
||||
@@ -81,10 +81,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* .plt and .iplt are here according to 'arm-zephyr-elf-ld --verbose',
|
||||
|
||||
@@ -45,10 +45,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
SECTION_PROLOGUE(_VECTOR_SECTION_NAME,,)
|
||||
{
|
||||
|
||||
@@ -20,10 +20,7 @@
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
SECTION_PROLOGUE(rom_start,,)
|
||||
{
|
||||
|
||||
@@ -126,10 +126,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The .plt and .iplt are here according to
|
||||
|
||||
@@ -66,10 +66,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
GROUP_START(ROMABLE_REGION)
|
||||
. = ROM_START; /* for kernel logging */
|
||||
|
||||
@@ -22,10 +22,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
__rom_region_start = .;
|
||||
|
||||
|
||||
@@ -76,10 +76,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/DISCARD/ :
|
||||
{
|
||||
|
||||
@@ -262,7 +262,5 @@ SECTION_PROLOGUE(.x86shadowstack.arr,,)
|
||||
.shstrtab 0 : { *(.shstrtab) }
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
|
||||
/*
|
||||
* Only define LLEXT sections if the subsystem is enabled.
|
||||
* Check here to avoid duplication in every linker script.
|
||||
*/
|
||||
#ifdef CONFIG_LLEXT
|
||||
/*
|
||||
* Save the current address to avoid changing it in this file.
|
||||
*/
|
||||
@@ -35,3 +40,4 @@
|
||||
#endif
|
||||
|
||||
. = __llext_current_addr;
|
||||
#endif /* CONFIG_LLEXT */
|
||||
|
||||
@@ -112,10 +112,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GEN_ISR_TABLES
|
||||
#include <zephyr/linker/intlist.ld>
|
||||
|
||||
@@ -176,10 +176,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GEN_ISR_TABLES
|
||||
#include <zephyr/linker/intlist.ld>
|
||||
|
||||
@@ -199,10 +199,7 @@ SECTIONS
|
||||
#endif /* CONFIG_BOOTLOADER_MCUBOOT */
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/* --- RTC BEGIN --- */
|
||||
|
||||
|
||||
@@ -115,10 +115,7 @@ SECTIONS
|
||||
} > metadata
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/* --- START OF IRAM --- */
|
||||
|
||||
|
||||
@@ -173,10 +173,7 @@ SECTIONS
|
||||
dram_size_field = LOADADDR(.dram0.end) - LOADADDR(.dram0.data);
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/* --- START OF IRAM --- */
|
||||
|
||||
|
||||
@@ -178,10 +178,7 @@ SECTIONS
|
||||
#endif /* CONFIG_BOOTLOADER_MCUBOOT */
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/* --- START OF RTC --- */
|
||||
|
||||
|
||||
@@ -185,10 +185,7 @@ SECTIONS
|
||||
#endif /* CONFIG_BOOTLOADER_MCUBOOT */
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/* --- START OF RTC --- */
|
||||
.rtc.text :
|
||||
|
||||
@@ -181,10 +181,7 @@ SECTIONS
|
||||
#endif /* CONFIG_BOOTLOADER_MCUBOOT */
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/* --- START OF RTC --- */
|
||||
.rtc.text :
|
||||
|
||||
@@ -196,10 +196,7 @@ SECTIONS
|
||||
|
||||
/* Virtual non-loadable sections */
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/* --- START OF RTC --- */
|
||||
|
||||
|
||||
@@ -209,10 +209,7 @@ SECTIONS
|
||||
|
||||
/* Virtual non-loadable sections */
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/* --- START OF RTC --- */
|
||||
|
||||
|
||||
@@ -156,10 +156,7 @@ SECTIONS
|
||||
} > metadata
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/* --- START OF IRAM --- */
|
||||
|
||||
|
||||
@@ -120,10 +120,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* .plt and .iplt are here according to 'arm-zephyr-elf-ld --verbose',
|
||||
|
||||
@@ -102,10 +102,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* .plt and .iplt are here according to 'arm-zephyr-elf-ld --verbose',
|
||||
|
||||
@@ -610,8 +610,5 @@ SECTIONS {
|
||||
#ifdef CONFIG_GEN_ISR_TABLES
|
||||
#include <zephyr/linker/intlist.ld>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -507,8 +507,5 @@ SECTIONS {
|
||||
#ifdef CONFIG_GEN_ISR_TABLES
|
||||
#include <zephyr/linker/intlist.ld>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -130,10 +130,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The .plt and .iplt are here according to
|
||||
|
||||
@@ -90,10 +90,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The .plt and .iplt are here according to
|
||||
|
||||
@@ -155,9 +155,6 @@ SECTIONS {
|
||||
* just dump it in an unreadable area at the top of memory.
|
||||
*/
|
||||
#include <zephyr/linker/intlist.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
} /* SECTIONS */
|
||||
|
||||
@@ -179,10 +179,8 @@ SECTIONS
|
||||
#endif
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
.ResetVector.text : ALIGN(4)
|
||||
{
|
||||
_ResetVector_text_start = ABSOLUTE(.);
|
||||
|
||||
@@ -179,10 +179,8 @@ SECTIONS
|
||||
#endif
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
.ResetVector.text : ALIGN(4)
|
||||
{
|
||||
_ResetVector_text_start = ABSOLUTE(.);
|
||||
|
||||
@@ -180,10 +180,8 @@ SECTIONS
|
||||
#endif
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
.ResetVector.text : ALIGN(4)
|
||||
{
|
||||
_ResetVector_text_start = ABSOLUTE(.);
|
||||
|
||||
@@ -180,10 +180,8 @@ SECTIONS
|
||||
#endif
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
.ResetVector.text : ALIGN(4)
|
||||
{
|
||||
_ResetVector_text_start = ABSOLUTE(.);
|
||||
|
||||
@@ -134,10 +134,8 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
.ResetVector.text : ALIGN(4)
|
||||
{
|
||||
_ResetVector_text_start = ABSOLUTE(.);
|
||||
|
||||
@@ -86,10 +86,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
SECTION_PROLOGUE(.plt,,)
|
||||
{
|
||||
|
||||
@@ -77,10 +77,7 @@ SECTIONS
|
||||
} > L2_PRIV_CH0
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
SECTION_PROLOGUE(.plt,,)
|
||||
{
|
||||
|
||||
@@ -13,10 +13,7 @@ SECTIONS
|
||||
{
|
||||
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_OPENAMP_RSC_TABLE
|
||||
|
||||
|
||||
@@ -14,8 +14,5 @@ SECTIONS
|
||||
{
|
||||
/* Standard Zephyr relocation section */
|
||||
#include <zephyr/linker/rel-sections.ld>
|
||||
|
||||
#ifdef CONFIG_LLEXT
|
||||
#include <zephyr/linker/llext-sections.ld>
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user