zephyr/tests/subsys/llext/simple/src
Luca Burelli 11c350e2e6 llext: fix handling of unimplemented syscalls
When building an LLEXT-enabled kernel, 62b19ef65c added weak aliases
of all syscall implementation functions to a pointer to NULL, with the
assumption that LLEXT would check the required symbols at link time and
fail if any of them were found.

This check, however, is ineffective in the current implementation: the
actual address that is exported is the rather normal-looking location of
the variable containing the NULL pointer. This defeats the NULL symbol
validity checks in llext_link.c and causes the extension to crash at
runtime by jumping to a location containing a few zeroes in read-only
data memory.

This commit makes sure the alias target is actually placed at address 0
using the llext-sections.ld linker fragment, so that undefined syscall
implementations are exported as NULLs and as such properly flagged at
link time.

The test for this functionality is also updated to reflect the change.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-10-08 16:59:50 +02:00
..
export_dependency_ext.c llext: add a test for inter-extension linking 2024-09-12 13:02:59 -04:00
export_dependent_ext.c llext: add a test for inter-extension linking 2024-09-12 13:02:59 -04:00
find_section_ext.c
hello_world_ext.c
init_fini_ext.c
logging_ext.c
movwmovt_ext.c
multi_file_ext1.c
multi_file_ext2.c
object_ext.c
pre_located_ext.c
relative_jump_ext.c
syscalls_ext.c
syscalls_ext.h
test_llext_simple.c llext: fix handling of unimplemented syscalls 2024-10-08 16:59:50 +02:00
threads_kernel_objects_ext.c llext: hotfix: fix device API tests for platforms without console 2024-10-03 22:01:08 +01:00
threads_kernel_objects_ext.h