cmake: LD: Specify the entry point in the linker scripts
The entry point can and therefore should be set by linker scripts. Whenever possible one should express things in the source language, be it .c or .ld, and not in code generators or in the build system. This patch removes the flag -eCONFIG_KERNEL_ENTRY from the linker's command line and replaces it with the linker script command ENTRY(CONFIG_KERNEL_ENTRY) Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
parent
dc9c0f1211
commit
347f9a0a2d
27 changed files with 26 additions and 28 deletions
|
@ -709,13 +709,10 @@ set_property(TARGET
|
|||
${ZEPHYR_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
get_property(E_KERNEL_ENTRY GLOBAL PROPERTY E_KERNEL_ENTRY)
|
||||
|
||||
set(zephyr_lnk
|
||||
${LINKERFLAGPREFIX},-Map=${PROJECT_BINARY_DIR}/${KERNEL_MAP_NAME}
|
||||
-u_OffsetAbsSyms
|
||||
-u_ConfigAbsSyms
|
||||
${E_KERNEL_ENTRY}
|
||||
${LINKERFLAGPREFIX},--start-group
|
||||
${LINKERFLAGPREFIX},--whole-archive
|
||||
${ZEPHYR_LIBS_PROPERTY}
|
||||
|
|
|
@ -10,7 +10,5 @@ zephyr_cc_option(-fno-delete-null-pointer-checks)
|
|||
|
||||
zephyr_cc_option_ifdef (CONFIG_LTO -flto)
|
||||
|
||||
set_property(GLOBAL PROPERTY E_KERNEL_ENTRY -e${CONFIG_KERNEL_ENTRY})
|
||||
|
||||
add_subdirectory(soc/${SOC_PATH})
|
||||
add_subdirectory(core)
|
||||
|
|
|
@ -8,8 +8,6 @@ set(ARCH_FOR_cortex-m23 armv8-m.base )
|
|||
set(ARCH_FOR_cortex-m33 armv8-m.main+dsp)
|
||||
set(ARCH_FOR_cortex-m33+nodsp armv8-m.main )
|
||||
|
||||
set_property(GLOBAL PROPERTY E_KERNEL_ENTRY -e${CONFIG_KERNEL_ENTRY})
|
||||
|
||||
if(ARCH_FOR_${GCC_M_CPU})
|
||||
set(ARCH_FLAG -march=${ARCH_FOR_${GCC_M_CPU}})
|
||||
endif()
|
||||
|
|
|
@ -32,7 +32,5 @@ else()
|
|||
zephyr_cc_option(-mno-hw-div)
|
||||
endif()
|
||||
|
||||
set_property(GLOBAL PROPERTY E_KERNEL_ENTRY -e${CONFIG_KERNEL_ENTRY})
|
||||
|
||||
add_subdirectory(soc/${SOC_PATH})
|
||||
add_subdirectory(core)
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
add_subdirectory(soc)
|
||||
add_subdirectory(core)
|
||||
|
||||
set_property(GLOBAL PROPERTY E_KERNEL_ENTRY -e${CONFIG_KERNEL_ENTRY})
|
||||
|
||||
set_property(GLOBAL PROPERTY PROPERTY_OUTPUT_FORMAT elf32-littleriscv)
|
||||
|
|
|
@ -24,8 +24,6 @@ endif()
|
|||
zephyr_cc_option_ifdef (CONFIG_LTO -flto)
|
||||
zephyr_cc_option_ifndef(CONFIG_SSE_FP_MATH -mno-sse)
|
||||
|
||||
set_property(GLOBAL PROPERTY E_KERNEL_ENTRY -e${CONFIG_KERNEL_ENTRY})
|
||||
|
||||
if(CMAKE_VERBOSE_MAKEFILE)
|
||||
set(GENIDT_EXTRA_ARGS --verbose)
|
||||
else()
|
||||
|
|
|
@ -7,6 +7,4 @@ else()
|
|||
add_subdirectory(soc/${SOC_PATH})
|
||||
endif()
|
||||
|
||||
set_property(GLOBAL PROPERTY E_KERNEL_ENTRY -e${CONFIG_KERNEL_ENTRY})
|
||||
|
||||
add_subdirectory(core)
|
||||
|
|
|
@ -88,7 +88,7 @@ PHDRS
|
|||
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(_ResetVector)
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* Memory boundary addresses: */
|
||||
_memmap_mem_dram1_start = 0x3ffc0000;
|
||||
|
|
|
@ -88,7 +88,7 @@ PHDRS
|
|||
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(_ResetVector)
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* Memory boundary addresses: */
|
||||
_memmap_mem_dport0_start = 0x3ffc0000;
|
||||
|
|
|
@ -81,7 +81,7 @@ PHDRS
|
|||
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(_ResetVector)
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* Memory boundary addresses: */
|
||||
_memmap_mem_sram_start = 0x4;
|
||||
|
|
|
@ -88,7 +88,7 @@ PHDRS
|
|||
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(_ResetVector)
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* Memory boundary addresses: */
|
||||
_memmap_mem_srom_start = 0x40000000;
|
||||
|
|
|
@ -61,7 +61,7 @@ PHDRS
|
|||
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(_ResetVector)
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* Memory boundary addresses: */
|
||||
_memmap_mem_dram0_start = 0x3ffe0000;
|
||||
|
|
|
@ -55,6 +55,7 @@ PHDRS
|
|||
|
||||
/* Default entry point: */
|
||||
PROVIDE ( _ResetVector = 0x40000400 );
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
_rom_store_table = 0;
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ PHDRS
|
|||
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(_ResetVector)
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* Memory boundary addresses: */
|
||||
_memmap_mem_dram1_start = 0x3ffc0000;
|
||||
|
|
|
@ -60,7 +60,7 @@ PHDRS
|
|||
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(_ResetVector)
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* Memory boundary addresses: */
|
||||
_memmap_mem_srom_start = 0x50000000;
|
||||
|
|
|
@ -60,7 +60,7 @@ PHDRS
|
|||
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(_ResetVector)
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* Memory boundary addresses: */
|
||||
_memmap_mem_srom_start = 0x50000000;
|
||||
|
|
|
@ -68,7 +68,7 @@ PHDRS
|
|||
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(_ResetVector)
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* Memory boundary addresses: */
|
||||
_memmap_mem_srom_start = 0x50000000;
|
||||
|
|
|
@ -54,7 +54,7 @@ PHDRS
|
|||
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(_ResetVector)
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* Memory boundary addresses: */
|
||||
_memmap_mem_dram0_start = 0x60000000;
|
||||
|
|
|
@ -54,7 +54,7 @@ PHDRS
|
|||
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(_ResetVector)
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* Memory boundary addresses: */
|
||||
_memmap_mem_dram0_start = 0x60000000;
|
||||
|
|
|
@ -145,6 +145,8 @@ PHDRS
|
|||
_rom_store_table = 0;
|
||||
PROVIDE(_memmap_vecbase_reset = XCHAL_VECBASE_RESET_PADDR_SRAM);
|
||||
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* Various memory-map dependent cache attribute settings: */
|
||||
_memmap_cacheattr_wb_base = 0x44024000;
|
||||
_memmap_cacheattr_wt_base = 0x11021000;
|
||||
|
|
|
@ -88,7 +88,7 @@ PHDRS
|
|||
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(_ResetVector)
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* Memory boundary addresses: */
|
||||
_memmap_mem_dram1_start = 0x3ffc0000;
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
#endif
|
||||
|
||||
OUTPUT_ARCH(arc)
|
||||
ENTRY(__start)
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
MEMORY {
|
||||
#ifdef FLASH_START
|
||||
|
|
|
@ -83,6 +83,8 @@ MEMORY
|
|||
IDT_LIST (wx) : ORIGIN = (RAM_ADDR + RAM_SIZE), LENGTH = 2K
|
||||
}
|
||||
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
GROUP_START(ROMABLE_REGION)
|
||||
|
|
|
@ -78,6 +78,8 @@ MEMORY
|
|||
}
|
||||
#endif
|
||||
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
GROUP_START(ROMABLE_REGION)
|
||||
|
|
|
@ -41,6 +41,8 @@ MEMORY
|
|||
IDT_LIST (wx) : ORIGIN = 0xFFFFF7FF, LENGTH = 2K
|
||||
}
|
||||
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@ MEMORY
|
|||
IDT_LIST (wx) : ORIGIN = 0xFFFFF7FF, LENGTH = 2K
|
||||
}
|
||||
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
GROUP_START(INSTRRAM)
|
||||
|
|
|
@ -61,6 +61,8 @@
|
|||
#define MMU_PAGE_ALIGN
|
||||
#endif
|
||||
|
||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||
|
||||
/* SECTIONS definitions */
|
||||
SECTIONS
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue