diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-09-12 12:48:22 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-09-12 12:48:22 -0600 |
commit | 939eb11d4bd5f3d1abcb397ffbcbea8a1f12f46a (patch) | |
tree | acd6868eb0e21638d1d47b34b1054a9987fe7989 | |
parent | 6f24cca893d475106749cedaa10c0bcf70a6a746 (diff) | |
download | nuttx-939eb11d4bd5f3d1abcb397ffbcbea8a1f12f46a.tar.gz nuttx-939eb11d4bd5f3d1abcb397ffbcbea8a1f12f46a.tar.bz2 nuttx-939eb11d4bd5f3d1abcb397ffbcbea8a1f12f46a.zip |
Having a symbol table is an option. There are no symbol tables with CONFIG_BUILD_KERNEL, for example.
-rw-r--r-- | nuttx/configs/sim/nsh/defconfig | 1 | ||||
-rw-r--r-- | nuttx/configs/stm32f4discovery/posix_spawn/defconfig | 1 | ||||
-rw-r--r-- | nuttx/libc/Kconfig | 11 | ||||
-rw-r--r-- | nuttx/libc/unistd/lib_execsymtab.c | 7 |
4 files changed, 20 insertions, 0 deletions
diff --git a/nuttx/configs/sim/nsh/defconfig b/nuttx/configs/sim/nsh/defconfig index 263a28303..1523139b8 100644 --- a/nuttx/configs/sim/nsh/defconfig +++ b/nuttx/configs/sim/nsh/defconfig @@ -409,6 +409,7 @@ CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_BOTH_CRLF is not set CONFIG_EOL_IS_EITHER_CRLF=y CONFIG_LIBC_EXECFUNCS=y +CONFIG_EXECFUNCS_HAVE_SYMTAB=y CONFIG_EXECFUNCS_SYMTAB="g_symtab" CONFIG_EXECFUNCS_NSYMBOLS=0 CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 diff --git a/nuttx/configs/stm32f4discovery/posix_spawn/defconfig b/nuttx/configs/stm32f4discovery/posix_spawn/defconfig index a8e0be0b5..ccce94eaf 100644 --- a/nuttx/configs/stm32f4discovery/posix_spawn/defconfig +++ b/nuttx/configs/stm32f4discovery/posix_spawn/defconfig @@ -609,6 +609,7 @@ CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_BOTH_CRLF is not set CONFIG_EOL_IS_EITHER_CRLF=y CONFIG_LIBC_EXECFUNCS=y +CONFIG_EXECFUNCS_HAVE_SYMTAB=y CONFIG_EXECFUNCS_SYMTAB="exports" CONFIG_EXECFUNCS_NSYMBOLS=10 CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 diff --git a/nuttx/libc/Kconfig b/nuttx/libc/Kconfig index 79b7cbc0f..e11e0a7cc 100644 --- a/nuttx/libc/Kconfig +++ b/nuttx/libc/Kconfig @@ -107,6 +107,16 @@ config LIBC_EXECFUNCS if LIBC_EXECFUNCS +config EXECFUNCS_HAVE_SYMTAB + bool "Have symbol table" + default n if BUILD_KERNEL + default y if !BUILD_KERNEL + ---help--- + If you have a system symbol table, then you must select this + option in order to use it. Symbol tables are required in most + cases in order to like executable programs to the base code. + +if EXECFUNCS_HAVE_SYMTAB config EXECFUNCS_SYMTAB string "Symbol table used by exec[l|v]" default "g_symtab" @@ -129,6 +139,7 @@ config EXECFUNCS_NSYMBOLS symbols in that table. This selection provides the number of symbols in the symbol table. +endif # EXECFUNCS_HAVE_SYMTAB endif # LIBC_EXECFUNCS config POSIX_SPAWN_PROXY_STACKSIZE diff --git a/nuttx/libc/unistd/lib_execsymtab.c b/nuttx/libc/unistd/lib_execsymtab.c index 34b798bb4..35df4c059 100644 --- a/nuttx/libc/unistd/lib_execsymtab.c +++ b/nuttx/libc/unistd/lib_execsymtab.c @@ -69,14 +69,21 @@ * Public Variables ****************************************************************************/ +#ifdef CONFIG_EXECFUNCS_HAVE_SYMTAB extern const struct symtab_s CONFIG_EXECFUNCS_SYMTAB; +#endif /**************************************************************************** * Private Data ****************************************************************************/ +#ifdef CONFIG_EXECFUNCS_HAVE_SYMTAB static FAR const struct symtab_s *g_exec_symtab = &CONFIG_EXECFUNCS_SYMTAB; static int g_exec_nsymbols = CONFIG_EXECFUNCS_NSYMBOLS; +#else +static FAR const struct symtab_s *g_exec_symtab; +static int g_exec_nsymbols; +#endif /**************************************************************************** * Public Functions |