Skip to content

Commit

Permalink
tools/mksymtab.sh: Add symbol table for modlib
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
JianyuWang0623 authored and xiaoxiang781216 committed Oct 9, 2024
1 parent 30df081 commit 98427f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/mksymtab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit 98427f6

Please sign in to comment.