zephyr/kernel
Ederson de Souza 321e395a8f 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 <ederson.desouza@intel.com>
2024-03-26 19:31:56 -04:00
..
include kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
paging kernel: mm: only include demand_paging.h if needed 2023-11-23 10:01:45 +01:00
atomic_c.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
banner.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
busy_wait.c kernel: Use k_us_to_cyc_ceil32 in k_busy_wait 2023-12-05 09:24:28 +01:00
CMakeLists.txt linker: Include libkernel.a in the whole-archive when llext is enabled 2024-03-26 19:31:56 -04:00
compiler_stack_protect.c kernel: canaries: Allow using TLS to store it 2023-08-08 19:08:04 -04:00
condvar.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
cpu_mask.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
device.c syscall: rename Z_OOPS -> K_OOPS 2023-11-03 11:46:52 +01:00
dynamic.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
dynamic_disabled.c kernel: dynamic: declare dynamic stubs when disabled 2023-07-24 12:59:43 -04:00
errno.c kernel: move syscall_handler.h to internal include directory 2023-11-03 11:46:52 +01:00
events.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
fatal.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
float.c kernel: move float operations out of thread.c 2024-03-06 19:27:28 -05:00
futex.c syscall: rename Z_SYSCALL_ to K_SYSCALL_ 2023-11-03 11:46:52 +01:00
idle.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
init.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
irq_offload.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
Kconfig sched: Remove multi-level queue priority limit 2024-03-12 19:37:40 -04:00
Kconfig.device kernel: reorg Kconfigs and split them 2024-03-06 19:27:28 -05:00
Kconfig.obj_core kernel: reorg Kconfigs and split them 2024-03-06 19:27:28 -05:00
Kconfig.smp kernel: reorg Kconfigs and split them 2024-03-06 19:27:28 -05:00
Kconfig.vm mm: introduce CONFIG_KERNEL_VM_USE_CUSTOM_MEM_RANGE_CHECK 2023-10-20 15:08:34 +02:00
kheap.c kernel: rename h -> heap 2024-03-06 19:27:28 -05:00
mailbox.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
main_weak.c kernel: Switch main return type from void to int 2023-04-14 07:49:41 +09:00
mem_domain.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
mem_slab.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
mempool.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
mmu.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
msg_q.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
mutex.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
obj_core.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
pipes.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
poll.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
priority_queues.c sched: Remove multi-level queue priority limit 2024-03-12 19:37:40 -04:00
queue.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
sched.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
sem.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
smp.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
spinlock_validate.c kernel: move spinlock validation to own file 2024-03-06 19:27:28 -05:00
stack.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
system_work_q.c init: remove the need for a dummy device pointer in SYS_INIT functions 2023-04-12 14:28:07 +00:00
thread.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
thread_monitor.c kernel: split thread monitor 2024-03-06 19:27:28 -05:00
timeout.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
timer.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
usage.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
userspace.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
userspace_handler.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
version.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
work.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
xip.c kernel: canaries: Allow using TLS to store it 2023-08-08 19:08:04 -04:00