From 98427f67f18ced5a6f21e2bd42fc3ff2506c6016 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Tue, 8 Oct 2024 20:45:14 +0800 Subject: [PATCH] tools/mksymtab.sh: Add symbol table for modlib Configs: +CONFIG_MODLIB_HAVE_SYMTAB=y CONFIG_MODLIB_SYMTAB_ARRAY="g_mod_symtab" CONFIG_MODLIB_NSYMBOLS_VAR="g_mod_nsymbols" Link error: LD: nuttx aarch64-none-elf-ld: /workspace/nuttx/staging/libc.a(modlib_symtab.o): in function `modlib_getsymtab': /workspace/nuttx/libs/libc/modlib/modlib_symtab.c:97:(.text.modlib_getsymtab+0xa0): undefined reference to `g_mod_symtab' aarch64-none-elf-ld: /workspace/nuttx/libs/libc/modlib/modlib_symtab.c:97:(.text.modlib_getsymtab+0xa4): undefined reference to `g_mod_symtab' aarch64-none-elf-ld: /workspace/nuttx/libs/libc/modlib/modlib_symtab.c:98:(.text.modlib_getsymtab+0xa8): undefined reference to `g_mod_nsymbols' aarch64-none-elf-ld: /workspace/nuttx/libs/libc/modlib/modlib_symtab.c:98:(.text.modlib_getsymtab+0xac): undefined reference to `g_mod_nsymbols' Signed-off-by: wangjianyu3 --- tools/mksymtab.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/mksymtab.sh b/tools/mksymtab.sh index 08d02373cf..400a196ba8 100755 --- a/tools/mksymtab.sh +++ b/tools/mksymtab.sh @@ -114,6 +114,8 @@ if [ -z "$prefix" ]; then echo "const struct symtab_s CONFIG_EXECFUNCS_SYMTAB_ARRAY[] = " echo "#elif defined(CONFIG_NSH_SYMTAB)" echo "const struct symtab_s CONFIG_NSH_SYMTAB_ARRAYNAME[] = " + echo "#elif defined(CONFIG_MODLIB_HAVE_SYMTAB)" + echo "const struct symtab_s CONFIG_MODLIB_SYMTAB_ARRAY[] = " echo "#else" echo "const struct symtab_s dummy_symtab[] = " echo "#endif" @@ -134,6 +136,8 @@ if [ -z "$prefix" ]; then echo "const int CONFIG_EXECFUNCS_NSYMBOLS_VAR = sizeof(CONFIG_EXECFUNCS_SYMTAB_ARRAY) / sizeof(struct symtab_s);" echo "#elif defined(CONFIG_NSH_SYMTAB)" echo "const int CONFIG_NSH_SYMTAB_COUNTNAME = sizeof(CONFIG_NSH_SYMTAB_ARRAYNAME) / sizeof(struct symtab_s);" + echo "#elif defined(CONFIG_MODLIB_HAVE_SYMTAB)" + echo "const int CONFIG_MODLIB_NSYMBOLS_VAR = sizeof(CONFIG_MODLIB_SYMTAB_ARRAY) / sizeof(struct symtab_s);" echo "#else" echo "const int dummy_nsymtabs = sizeof(dummy_symtab) / sizeof(struct symtab_s);" echo "#endif"