zephyr/subsys/llext
Luca Burelli 78ae035f89 llext: fix link order for weak syscall symbols
The weak syscall symbols generated by gen_syscalls.py are currently
compiled in the LLEXT subsystem library, which is then linked among all
other Zephyr libraries in an unspecified order. This can cause the weak
symbols to override the actual syscall implementations, leading to
undefined behaviour.

To fix this, the currently generated file is split in two elements:

- syscall_exports_llext.c contains the EXPORT_SYMBOL directives for all
  syscalls. This part can be compiled with the LLEXT library and linked
  among all other Zephyr libraries, and ensures all syscalls symbols
  are preserved by the linker.

- syscall_weakdefs_llext.c contains the weak definitions for all syscalls.
  This file is compiled in a separate library that is linked last, so
  that the weak symbols are only used if no other implementation is
  available.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-12-10 20:38:48 +01:00
..
buf_loader.c
CMakeLists.txt llext: Add RISC-V arch-specific relocations 2024-10-03 21:59:42 +01:00
fs_loader.c llext: Add filesystem based extension loader 2024-09-06 11:26:09 -04:00
Kconfig LLEXT: Xtensa: add a Kconfig option to enable -fPIC 2024-11-16 15:28:00 -05:00
llext_export.c llext: fix link order for weak syscall symbols 2024-12-10 20:38:48 +01:00
llext_handlers.c llext: hotfix: fix function pointer logging 2024-09-11 13:59:02 -04:00
llext_link.c llext: fix minor Coverity issue #434586 2024-11-27 10:29:23 +01:00
llext_load.c LLEXT: no repeated linking with inline relocations 2024-11-20 10:17:06 +00:00
llext_mem.c LLEXT: fix a needless allocation 2024-11-16 14:56:23 -05:00
llext_priv.h LLEXT: fix a needless allocation 2024-11-16 14:56:23 -05:00
llext.c LLEXT: add llext_section_offset() to replace llext_find_section() 2024-11-16 15:28:00 -05:00
shell.c llext: Add shell command for loading LLEXT from a filesystem 2024-09-06 11:26:09 -04:00