zephyr/cmake/modules
Grzegorz Swiderski 460b6ef122 code_relocation: Add NOKEEP option
When using the code and data relocation feature, every relocated symbol
would be marked with `KEEP()` in the generated linker script. Therefore,
if any input files contained unused code, then it wouldn't be discarded
by the linker, even when invoked with `--gc-sections`.

This can cause unexpected bloat, or other link-time issues stemming from
some symbols being discarded and others not.

On the other hand, this behavior has been present since the feature's
introduction, so it should remain default for the users who rely on it.

This patch introduces support for `zephyr_code_relocate(... NOKEEP)`.
This will suppress the generation of `KEEP()` statements for all symbols
in a particular library or set of files.

Much like `NOCOPY`, the `NOKEEP` flag is passed to `gen_relocate_app.py`
in string form. The script is now equipped to handle multiple such flags
when passed from CMake as a semicolon-separated list, like so:

   "SRAM2:NOCOPY;NOKEEP:/path/to/file1.c;/path/to/file2.c"

Documentation and tests are updated here as well.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-01-15 13:20:17 +01:00
..
arch.cmake
basic_settings.cmake
boards.cmake cmake: modules: add support for board extensions 2023-08-21 16:28:22 +02:00
ccache.cmake
configuration_files.cmake cmake: Remove support for deprecated prj_board.conf 2023-12-06 10:28:12 -05:00
doc.cmake
dts.cmake cmake: modules: dts: Fix board revision 0 overlay 2023-11-22 21:55:17 +01:00
extensions.cmake code_relocation: Add NOKEEP option 2024-01-15 13:20:17 +01:00
Findarmclang.cmake cmake: armclang version detection 2023-09-13 16:23:30 +02:00
FindBabbleSim.cmake
FindDeprecated.cmake cmake: remove deprecated XCC_USE_CLANG 2023-12-14 09:31:45 +01:00
FindDtc.cmake
FindGnuLd.cmake cmake: modules/FindGnuLd: cache variable GNULD_VERSION_STRING 2023-09-01 09:02:38 -04:00
FindHostTools.cmake cmake: remove deprecated XCC_USE_CLANG 2023-12-14 09:31:45 +01:00
FindLlvmLld.cmake cmake: Fix FindLlvmLld usage of unimported package 2023-06-26 12:40:03 +00:00
FindoneApi.cmake cmake: Fix FindLlvmLld usage of unimported package 2023-06-26 12:40:03 +00:00
FindScaTools.cmake
FindTargetTools.cmake
FindZephyr-sdk.cmake ARC: MWDT: rework GNU helper tools usage 2023-06-17 07:44:31 -04:00
generated_file_directories.cmake
kconfig.cmake cmake: expose TOOLCHAIN_HAS_PICOLIBC to kconfig 2023-09-13 17:36:46 -04:00
kernel.cmake cmake: warn the user that the toolchain cache hides errors 2023-09-22 13:42:21 +02:00
pre_dt.cmake
python.cmake cmake: drop ERROR_QUIET in python.cmake 2023-12-13 13:56:59 +01:00
root.cmake cmake: boards: Fix issue with relative paths 2023-06-15 05:10:42 -04:00
shields.cmake cmake: modules: shields: Process shields in order 2024-01-09 10:03:15 +01:00
snippets.cmake cmake: support snippets scope for zephyr_get() 2023-05-25 13:31:53 +00:00
soc.cmake
unittest.cmake unittest: Generate symbol for existent modules 2023-10-27 13:33:30 -05:00
user_cache.cmake
version.cmake cmake: version: Fix example comment 2023-09-01 17:44:28 +02:00
west.cmake cmake: cleanup old west version support 2023-08-24 10:47:00 +02:00
zephyr_default.cmake cmake: add ZephyrAppConfiguration package 2023-08-17 10:36:45 +02:00
zephyr_module.cmake cmake: align Zephyr module variable to EXTRA_ZEPHYR_MODULES 2023-05-23 16:40:21 +02:00