forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linker: Include libkernel.a in the whole-archive when llext is enabled
Differently from other libraries, which are included whole in the final Zephyr ELF, libkernel.a itself isn't. Assuming this is intended to enable optimisations (if it isn't, this patch will break things) - linker can remove parts of the kernel that are not used by the application. However, when considering Linkable Loadable Extensions (llext), this optimisations can be counterproductive: for instance, syscalls that are not used by the application won't be available for extensions. It won't matter if someone "EXPORT_SYMBOL" for them, or even try to keep them using LINKER_KEEP, they'll be gone. To avoid that, this patches includes, when CONFIG_LLEXT=y, libkernel.a inside the linker "whole-archive" block. This ends up making it consider libkernel.a as a library whose all symbols should be kept. Note this doesn't mean that all symbols will be there - things compiled out via Kconfig will naturally still be out. Signed-off-by: Ederson de Souza <[email protected]>
- Loading branch information
1 parent
a924c87
commit 321e395
Showing
6 changed files
with
16 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters