Skip to content

Commit

Permalink
llext: fix Z_GENERIC_SECTION() usage
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
lyakh authored and kartben committed Jan 22, 2025
1 parent 0689d6d commit 76e1e1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/zephyr/llext/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
}
Expand Down Expand Up @@ -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) = { \
Expand Down
6 changes: 3 additions & 3 deletions tests/subsys/llext/src/init_fini_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down

0 comments on commit 76e1e1b

Please sign in to comment.