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:
Sebastian Bøe 2018-06-22 16:07:36 +02:00 committed by Anas Nashif
commit 347f9a0a2d
27 changed files with 26 additions and 28 deletions

View file

@ -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}

View file

@ -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)

View file

@ -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()

View file

@ -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)

View file

@ -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)

View file

@ -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()

View file

@ -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)

View file

@ -88,7 +88,7 @@ PHDRS
/* Default entry point: */
ENTRY(_ResetVector)
ENTRY(CONFIG_KERNEL_ENTRY)
/* Memory boundary addresses: */
_memmap_mem_dram1_start = 0x3ffc0000;

View file

@ -88,7 +88,7 @@ PHDRS
/* Default entry point: */
ENTRY(_ResetVector)
ENTRY(CONFIG_KERNEL_ENTRY)
/* Memory boundary addresses: */
_memmap_mem_dport0_start = 0x3ffc0000;

View file

@ -81,7 +81,7 @@ PHDRS
/* Default entry point: */
ENTRY(_ResetVector)
ENTRY(CONFIG_KERNEL_ENTRY)
/* Memory boundary addresses: */
_memmap_mem_sram_start = 0x4;

View file

@ -88,7 +88,7 @@ PHDRS
/* Default entry point: */
ENTRY(_ResetVector)
ENTRY(CONFIG_KERNEL_ENTRY)
/* Memory boundary addresses: */
_memmap_mem_srom_start = 0x40000000;

View file

@ -61,7 +61,7 @@ PHDRS
/* Default entry point: */
ENTRY(_ResetVector)
ENTRY(CONFIG_KERNEL_ENTRY)
/* Memory boundary addresses: */
_memmap_mem_dram0_start = 0x3ffe0000;

View file

@ -55,6 +55,7 @@ PHDRS
/* Default entry point: */
PROVIDE ( _ResetVector = 0x40000400 );
ENTRY(CONFIG_KERNEL_ENTRY)
_rom_store_table = 0;

View file

@ -88,7 +88,7 @@ PHDRS
/* Default entry point: */
ENTRY(_ResetVector)
ENTRY(CONFIG_KERNEL_ENTRY)
/* Memory boundary addresses: */
_memmap_mem_dram1_start = 0x3ffc0000;

View file

@ -60,7 +60,7 @@ PHDRS
/* Default entry point: */
ENTRY(_ResetVector)
ENTRY(CONFIG_KERNEL_ENTRY)
/* Memory boundary addresses: */
_memmap_mem_srom_start = 0x50000000;

View file

@ -60,7 +60,7 @@ PHDRS
/* Default entry point: */
ENTRY(_ResetVector)
ENTRY(CONFIG_KERNEL_ENTRY)
/* Memory boundary addresses: */
_memmap_mem_srom_start = 0x50000000;

View file

@ -68,7 +68,7 @@ PHDRS
/* Default entry point: */
ENTRY(_ResetVector)
ENTRY(CONFIG_KERNEL_ENTRY)
/* Memory boundary addresses: */
_memmap_mem_srom_start = 0x50000000;

View file

@ -54,7 +54,7 @@ PHDRS
/* Default entry point: */
ENTRY(_ResetVector)
ENTRY(CONFIG_KERNEL_ENTRY)
/* Memory boundary addresses: */
_memmap_mem_dram0_start = 0x60000000;

View file

@ -54,7 +54,7 @@ PHDRS
/* Default entry point: */
ENTRY(_ResetVector)
ENTRY(CONFIG_KERNEL_ENTRY)
/* Memory boundary addresses: */
_memmap_mem_dram0_start = 0x60000000;

View file

@ -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;

View file

@ -88,7 +88,7 @@ PHDRS
/* Default entry point: */
ENTRY(_ResetVector)
ENTRY(CONFIG_KERNEL_ENTRY)
/* Memory boundary addresses: */
_memmap_mem_dram1_start = 0x3ffc0000;

View file

@ -55,7 +55,7 @@
#endif
OUTPUT_ARCH(arc)
ENTRY(__start)
ENTRY(CONFIG_KERNEL_ENTRY)
MEMORY {
#ifdef FLASH_START

View file

@ -83,6 +83,8 @@ MEMORY
IDT_LIST (wx) : ORIGIN = (RAM_ADDR + RAM_SIZE), LENGTH = 2K
}
ENTRY(CONFIG_KERNEL_ENTRY)
SECTIONS
{
GROUP_START(ROMABLE_REGION)

View file

@ -78,6 +78,8 @@ MEMORY
}
#endif
ENTRY(CONFIG_KERNEL_ENTRY)
SECTIONS
{
GROUP_START(ROMABLE_REGION)

View file

@ -41,6 +41,8 @@ MEMORY
IDT_LIST (wx) : ORIGIN = 0xFFFFF7FF, LENGTH = 2K
}
ENTRY(CONFIG_KERNEL_ENTRY)
SECTIONS
{

View file

@ -37,6 +37,8 @@ MEMORY
IDT_LIST (wx) : ORIGIN = 0xFFFFF7FF, LENGTH = 2K
}
ENTRY(CONFIG_KERNEL_ENTRY)
SECTIONS
{
GROUP_START(INSTRRAM)

View file

@ -61,6 +61,8 @@
#define MMU_PAGE_ALIGN
#endif
ENTRY(CONFIG_KERNEL_ENTRY)
/* SECTIONS definitions */
SECTIONS
{