zephyr/scripts
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
..
build code_relocation: Add NOKEEP option 2024-01-15 13:20:17 +01:00
checkpatch
ci ci: merged_pr stats: fix a bug an minor tweaks 2024-01-12 21:35:04 -05:00
coccinelle
coredump xtensa: rename z_xtensa to simply xtensa 2023-12-13 09:41:24 +01:00
dts devicetree: encode multi-level interrupt number in C devicetree magic 2023-10-30 11:43:39 -04:00
footprint scripts/footprint: Avoid fpdiff failure when data changes lots 2024-01-10 20:50:51 -05:00
generate_usb_vif
gitlint gitlint: exclude long line with co-authored-by 2023-09-27 06:20:16 -04:00
kconfig tfm: Harded build against TF-M built with unsecure keys 2023-12-12 19:08:46 +01:00
logging/dictionary scripts: logging/dictionary/sys-t: remove escape between CDATA 2023-12-15 14:34:15 +01:00
native_simulator native_simulator: Get latest from upstream 2023-11-27 16:06:42 +00:00
net net: scripts: Use native_sim instead of native_posix 2023-11-27 19:55:30 +01:00
pylib scripts: twister: testplan: search for requested snippets 2024-01-11 11:40:32 -05:00
pylint/checkers
release
schemas scripts: twister: add copying of bsim exe 2024-01-10 12:10:58 +01:00
support
tests scripts: tests: Removal of straggling folders 2024-01-10 09:23:06 -05:00
tracing
utils scripts: utils: add guidelines converter script 2023-10-30 13:46:23 -04:00
west_commands runners: jlink: Add support for J-Link over IP 2024-01-09 14:49:03 +01:00
.gitignore
checkpatch.pl scripts: checkpatch.pl: Add exceptions for FOR_EACH_NONEMPTY_TERM macro 2024-01-02 16:01:11 +00:00
checkstack.pl
coccicheck
dump_bugs_pickle.py
gen_gcov_files.py
get_maintainer.py MAINTAINERS: add 2 new keys: tags, tests 2023-12-22 09:54:12 +01:00
github_helpers.py
list_boards.py
make_bugs_pickle.py
requirements-base.txt
requirements-build-test.txt scripts: coverage: gcovr to ignore negative counters 2023-11-03 07:57:10 -04:00
requirements-compliance.txt
requirements-extras.txt scripts: Update CFB font generator 2023-09-13 14:40:00 -07:00
requirements-run-test.txt
requirements.txt
series-push-hook.sh
set_assignees.py scripts: set_maintainer: do not re-add self-removed reviewers 2024-01-11 15:46:20 -06:00
snippets.py twister: Add support for required snippets 2023-09-06 16:40:53 +02:00
spelling.txt scripts: sync spelling.txt with version from Linux kernel v6.7-rc1 2023-11-15 17:33:17 -05:00
tags.sh
twister twister: implement simulation_exclude filter 2023-12-19 07:33:39 -05:00
valgrind.supp valgrind: Update POSIX soc no cpu cleanup suppression 2023-11-29 15:33:49 +01:00
west-commands.yml west: commands: Add bindesc command 2023-09-28 07:39:09 -04:00
zephyr_module.py scripts: kconfig: Always generate ZEPHYR_*_MODULE 2023-10-24 10:53:24 +02:00