From 9ca541a5044157a07c908c0da1546230b3842f72 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Mon, 8 Jun 2020 10:32:24 -0500 Subject: [PATCH] linker: Remove deprecated Kconfig options related to linker scripts Remove Kconfig, linker script, and related bits associated with CUSTOM_RODATA_LD, CUSTOM_RWDATA_LD, CUSTOM_SECTIONS_LD, SOC_NOINIT_LD, SOC_RODATA_LD, and SOC_RWDATA_LD options that have been deprecated since Zephyr 2.2. Signed-off-by: Kumar Gala --- CMakeLists.txt | 7 ---- Kconfig.zephyr | 21 ----------- include/arch/arc/v2/linker.ld | 23 ------------ .../arm/aarch32/cortex_a_r/scripts/linker.ld | 24 ------------ .../arm/aarch32/cortex_m/scripts/linker.ld | 26 ------------- include/arch/arm/aarch64/scripts/linker.ld | 24 ------------ include/arch/nios2/linker.ld | 23 ------------ include/arch/riscv/common/linker.ld | 9 ----- include/arch/x86/ia32/linker.ld | 23 ------------ include/arch/x86/intel64/linker.ld | 10 ----- scripts/kconfig/hardened.csv | 3 -- soc/Kconfig | 37 ------------------- soc/riscv/openisa_rv32m1/linker.ld | 4 -- 13 files changed, 234 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69c21a7f10b..7709cbcfc53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -376,13 +376,6 @@ if(NOT EXISTS ${LINKER_SCRIPT}) message(FATAL_ERROR "Could not find linker script: '${LINKER_SCRIPT}'. Corrupted configuration?") endif() -# Custom section support in linker scripts requires that the application source -# directory is in the preprocessor search path, in order to find the custom -# linker script fragments. -if(CONFIG_CUSTOM_RODATA_LD OR CONFIG_CUSTOM_RWDATA_LD OR CONFIG_CUSTOM_SECTIONS_LD) - zephyr_include_directories(${APPLICATION_SOURCE_DIR}) -endif() - configure_file(version.h.in ${PROJECT_BINARY_DIR}/include/generated/version.h) # Error-out when the deprecated naming convention is found (until diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 3b2fc777805..4c340d1f068 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -153,27 +153,6 @@ config CUSTOM_LINKER_SCRIPT linker script and avoid having to change the script provided by Zephyr. -config CUSTOM_RODATA_LD - bool "(DEPRECATED) Include custom-rodata.ld" - help - Note: This is deprecated, use Cmake function zephyr_linker_sources() instead. - Include a customized linker script fragment for inserting additional - data and linker directives into the rodata section. - -config CUSTOM_RWDATA_LD - bool "(DEPRECATED) Include custom-rwdata.ld" - help - Note: This is deprecated, use Cmake function zephyr_linker_sources() instead. - Include a customized linker script fragment for inserting additional - data and linker directives into the data section. - -config CUSTOM_SECTIONS_LD - bool "(DEPRECATED) Include custom-sections.ld" - help - Note: This is deprecated, use Cmake function zephyr_linker_sources() instead. - Include a customized linker script fragment for inserting additional - arbitrary sections. - config KERNEL_ENTRY string "Kernel entry symbol" default "__start" diff --git a/include/arch/arc/v2/linker.ld b/include/arch/arc/v2/linker.ld index bbb41196ce8..e83a9f3e886 100644 --- a/include/arch/arc/v2/linker.ld +++ b/include/arch/arc/v2/linker.ld @@ -116,14 +116,6 @@ SECTIONS { * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RODATA_LD -#include -#endif - -#ifdef CONFIG_CUSTOM_RODATA_LD -/* Located in project source directory */ -#include -#endif #include @@ -193,9 +185,6 @@ SECTIONS { * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_NOINIT_LD -#include -#endif } GROUP_LINK_IN(RAMABLE_REGION) @@ -211,14 +200,6 @@ SECTIONS { * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RWDATA_LD -#include -#endif - -#ifdef CONFIG_CUSTOM_RWDATA_LD -/* Located in project source directory */ -#include -#endif } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) @@ -241,10 +222,6 @@ SECTIONS { GROUP_END(RAMABLE_REGION) -#ifdef CONFIG_CUSTOM_SECTIONS_LD -/* Located in project source directory */ -#include -#endif /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */ diff --git a/include/arch/arm/aarch32/cortex_a_r/scripts/linker.ld b/include/arch/arm/aarch32/cortex_a_r/scripts/linker.ld index 57c73e680a8..b73808f7c59 100644 --- a/include/arch/arm/aarch32/cortex_a_r/scripts/linker.ld +++ b/include/arch/arm/aarch32/cortex_a_r/scripts/linker.ld @@ -185,14 +185,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RODATA_LD -#include -#endif - -#ifdef CONFIG_CUSTOM_RODATA_LD -/* Located in project source directory */ -#include -#endif #include @@ -293,9 +285,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_NOINIT_LD -#include -#endif } GROUP_LINK_IN(RAMABLE_REGION) @@ -310,14 +299,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RWDATA_LD -#include -#endif - -#ifdef CONFIG_CUSTOM_RWDATA_LD -/* Located in project source directory */ -#include -#endif #ifdef CONFIG_CODE_DATA_RELOCATION #include @@ -344,11 +325,6 @@ SECTIONS GROUP_END(RAMABLE_REGION) -#ifdef CONFIG_CUSTOM_SECTIONS_LD -/* Located in project source directory */ -#include -#endif - /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */ diff --git a/include/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/arch/arm/aarch32/cortex_m/scripts/linker.ld index 020d77f0f1a..863f6182a7f 100644 --- a/include/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -211,14 +211,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RODATA_LD -#include -#endif - -#ifdef CONFIG_CUSTOM_RODATA_LD -/* Located in project source directory */ -#include -#endif #include @@ -335,9 +327,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_NOINIT_LD -#include -#endif } GROUP_LINK_IN(RAMABLE_REGION) @@ -354,14 +343,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RWDATA_LD -#include -#endif - -#ifdef CONFIG_CUSTOM_RWDATA_LD -/* Located in project source directory */ -#include -#endif #ifdef CONFIG_CODE_DATA_RELOCATION #include @@ -419,9 +400,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_NOINIT_LD -#include -#endif } GROUP_LINK_IN(RAMABLE_REGION) #endif /* CONFIG_USERSPACE */ @@ -472,10 +450,6 @@ GROUP_START(DTCM) GROUP_END(DTCM) #endif -#ifdef CONFIG_CUSTOM_SECTIONS_LD -/* Located in project source directory */ -#include -#endif /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. diff --git a/include/arch/arm/aarch64/scripts/linker.ld b/include/arch/arm/aarch64/scripts/linker.ld index f70817fb657..16e20a5344c 100644 --- a/include/arch/arm/aarch64/scripts/linker.ld +++ b/include/arch/arm/aarch64/scripts/linker.ld @@ -181,14 +181,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RODATA_LD -#include -#endif - -#ifdef CONFIG_CUSTOM_RODATA_LD -/* Located in project source directory */ -#include -#endif #include @@ -279,9 +271,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_NOINIT_LD -#include -#endif } GROUP_LINK_IN(RAMABLE_REGION) @@ -296,14 +285,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RWDATA_LD -#include -#endif - -#ifdef CONFIG_CUSTOM_RWDATA_LD -/* Located in project source directory */ -#include -#endif #ifdef CONFIG_CODE_DATA_RELOCATION #include @@ -330,11 +311,6 @@ SECTIONS GROUP_END(RAMABLE_REGION) -#ifdef CONFIG_CUSTOM_SECTIONS_LD -/* Located in project source directory */ -#include -#endif - /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */ diff --git a/include/arch/nios2/linker.ld b/include/arch/nios2/linker.ld index a949cc24fed..7c6a5db38a7 100644 --- a/include/arch/nios2/linker.ld +++ b/include/arch/nios2/linker.ld @@ -149,14 +149,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RODATA_LD -#include -#endif - -#ifdef CONFIG_CUSTOM_RODATA_LD -/* Located in project source directory */ -#include -#endif . = ALIGN(4); } GROUP_LINK_IN(ROMABLE_REGION) @@ -203,14 +195,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RWDATA_LD -#include -#endif - -#ifdef CONFIG_CUSTOM_RWDATA_LD -/* Located in project source directory */ -#include -#endif /* the Nios2 architecture only has 16-bit signed immediate offsets in * the instructions, so accessing a general address requires typically @@ -270,9 +254,6 @@ SECTIONS *(.noinit) *(".noinit.*") -#ifdef CONFIG_SOC_NOINIT_LD -#include -#endif /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */ @@ -288,10 +269,6 @@ SECTIONS GROUP_END(RAMABLE_REGION) -#ifdef CONFIG_CUSTOM_SECTIONS_LD -/* Located in project source directory */ -#include -#endif /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */ diff --git a/include/arch/riscv/common/linker.ld b/include/arch/riscv/common/linker.ld index c3955d1ddfc..954b3425a01 100644 --- a/include/arch/riscv/common/linker.ld +++ b/include/arch/riscv/common/linker.ld @@ -125,9 +125,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RODATA_LD -#include -#endif } GROUP_LINK_IN(ROMABLE_REGION) @@ -156,9 +153,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RWDATA_LD -#include -#endif } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) @@ -203,9 +197,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_NOINIT_LD -#include -#endif } GROUP_LINK_IN(RAMABLE_REGION) diff --git a/include/arch/x86/ia32/linker.ld b/include/arch/x86/ia32/linker.ld index a839303703a..3adf0f53f25 100644 --- a/include/arch/x86/ia32/linker.ld +++ b/include/arch/x86/ia32/linker.ld @@ -151,14 +151,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RODATA_LD -#include -#endif - -#ifdef CONFIG_CUSTOM_RODATA_LD -/* Located in project source directory */ -#include -#endif #include } GROUP_LINK_IN(ROMABLE_REGION) @@ -246,9 +238,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_NOINIT_LD -#include -#endif MMU_PAGE_ALIGN @@ -284,14 +273,6 @@ SECTIONS * zephyr_linker_sources() Cmake function. */ #include -#ifdef CONFIG_SOC_RWDATA_LD -#include -#endif - -#ifdef CONFIG_CUSTOM_RWDATA_LD -/* Located in project source directory */ -#include -#endif #ifdef CONFIG_X86_KPTI MMU_PAGE_ALIGN @@ -390,10 +371,6 @@ SECTIONS -#ifdef CONFIG_CUSTOM_SECTIONS_LD -/* Located in project source directory */ -#include -#endif /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */ diff --git a/include/arch/x86/intel64/linker.ld b/include/arch/x86/intel64/linker.ld index 5bc38f84334..8f1ba53ab81 100644 --- a/include/arch/x86/intel64/linker.ld +++ b/include/arch/x86/intel64/linker.ld @@ -105,10 +105,6 @@ SECTIONS #include - #ifdef CONFIG_CUSTOM_RODATA_LD - #include - #endif /* CONFIG_CUSTOM_RODATA_LD */ - #ifdef CONFIG_X86_MMU . = ALIGN(8); _mmu_region_list_start = .; @@ -165,18 +161,12 @@ SECTIONS } GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION) #include -#ifdef CONFIG_CUSTOM_SECTIONS_LD -#include -#endif /* CONFIG_CUSTOM_SECTIONS_LD */ SECTION_PROLOGUE(_DATA_SECTION_NAME,,ALIGN(16)) { *(.data) *(.data.*) #include - #ifdef CONFIG_CUSTOM_RWDATA_LD - #include - #endif /* CONFIG_CUSTOM_RWDATA_LD */ } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) #include diff --git a/scripts/kconfig/hardened.csv b/scripts/kconfig/hardened.csv index d5ae85b0c9b..0da17fea5a6 100644 --- a/scripts/kconfig/hardened.csv +++ b/scripts/kconfig/hardened.csv @@ -33,9 +33,6 @@ TEST,n TEST_SHELL,n TEST_EXTRA_STACKSIZE,0 TEST_USERSPACE,n -CUSTOM_RODATA_LD,n -CUSTOM_RWDATA_LD,n -CUSTOM_SECTIONS_LD,n BUILD_OUTPUT_STRIPPED,y SOC_ATMEL_SAME70_DISABLE_ERASE_PIN,y SOC_ATMEL_SAME70_WAIT_MODE,n diff --git a/soc/Kconfig b/soc/Kconfig index 0dc8dfd4639..f411239de4c 100644 --- a/soc/Kconfig +++ b/soc/Kconfig @@ -35,43 +35,6 @@ config SOC_COMPATIBLE_NRF52832 # SOC_*_LD: SoC specific Linker script additions # -if ARC || ARM || X86 || NIOS2 || RISCV - -config SOC_NOINIT_LD - bool - help - Note: This is deprecated, use Cmake function zephyr_linker_sources() instead. - Include an SoC specific linker script fragment named soc-noinit.ld - for inserting additional data and linker directives into - the noinit section. - - This only has effect if the SoC uses the common linker script - under include/arch/. - -config SOC_RODATA_LD - bool - help - Note: This is deprecated, use Cmake function zephyr_linker_sources() instead. - Include an SoC specific linker script fragment named soc-rodata.ld - for inserting additional data and linker directives into - the rodata section. - - This only has effect if the SoC uses the common linker script - under include/arch/. - -config SOC_RWDATA_LD - bool - help - Note: This is deprecated, use Cmake function zephyr_linker_sources() instead. - Include an SoC specific linker script fragment named soc-rwdata.ld - for inserting additional data and linker directives into - the data section. - - This only has effect if the SoC uses the common linker script - under include/arch/. - -endif # ARC || ARM || X86 || NIOS2 || RISCV - config SOC_DEPRECATED_RELEASE string help diff --git a/soc/riscv/openisa_rv32m1/linker.ld b/soc/riscv/openisa_rv32m1/linker.ld index e63459b52e3..7416984c405 100644 --- a/soc/riscv/openisa_rv32m1/linker.ld +++ b/soc/riscv/openisa_rv32m1/linker.ld @@ -228,10 +228,6 @@ SECTIONS GROUP_END(RAM) -#ifdef CONFIG_CUSTOM_SECTIONS_LD -/* Located in project source directory */ -#include -#endif /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */