From 76e1e1b80470b890c0f326cdefe383d80f30c9ac Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Mon, 20 Jan 2025 13:50:42 +0100 Subject: [PATCH] llext: fix Z_GENERIC_SECTION() usage Z_GENERIC_SECTION() uses STRINGIFY() to convert its argument to a string, therefore the argument shouldn't contain additional quotes. Signed-off-by: Guennadi Liakhovetski --- include/zephyr/llext/symbol.h | 4 ++-- tests/subsys/llext/src/init_fini_ext.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/zephyr/llext/symbol.h b/include/zephyr/llext/symbol.h index c0b7004ed17..9a1394489cb 100644 --- a/include/zephyr/llext/symbol.h +++ b/include/zephyr/llext/symbol.h @@ -92,7 +92,7 @@ struct llext_symtable { /* Extension build: add exported symbols to llext table */ #define Z_LL_EXTENSION_SYMBOL_NAMED(sym_ident, sym_name) \ static const struct llext_const_symbol \ - Z_GENERIC_SECTION(".exported_sym") __used \ + Z_GENERIC_SECTION(.exported_sym) __used \ __llext_sym_ ## sym_name = { \ .name = STRINGIFY(sym_name), .addr = (const void *)&sym_ident, \ } @@ -135,7 +135,7 @@ struct llext_symtable { #elif defined(CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID) /* SLID-enabled LLEXT application: export symbols, names in separate section */ #define Z_EXPORT_SYMBOL_NAMED(sym_ident, sym_name) \ - static const char Z_GENERIC_SECTION("llext_exports_strtab") __used \ + static const char Z_GENERIC_SECTION(llext_exports_strtab) __used \ __llext_sym_name_ ## sym_name[] = STRINGIFY(sym_name); \ static const STRUCT_SECTION_ITERABLE(llext_const_symbol, \ __llext_sym_ ## sym_name) = { \ diff --git a/tests/subsys/llext/src/init_fini_ext.c b/tests/subsys/llext/src/init_fini_ext.c index 13cd4e741d7..258c907b089 100644 --- a/tests/subsys/llext/src/init_fini_ext.c +++ b/tests/subsys/llext/src/init_fini_ext.c @@ -49,14 +49,14 @@ static void fini_fn(void) number |= 4; } -static const void *const preinit_fn_ptrs[] __used Z_GENERIC_SECTION(".preinit_array") = { +static const void *const preinit_fn_ptrs[] __used Z_GENERIC_SECTION(.preinit_array) = { preinit_fn_1, preinit_fn_2 }; -static const void *const init_fn_ptrs[] __used Z_GENERIC_SECTION(".init_array") = { +static const void *const init_fn_ptrs[] __used Z_GENERIC_SECTION(.init_array) = { init_fn }; -static const void *const fini_fn_ptrs[] __used Z_GENERIC_SECTION(".fini_array") = { +static const void *const fini_fn_ptrs[] __used Z_GENERIC_SECTION(.fini_array) = { fini_fn };