diff --git a/examples/README.txt b/examples/README.txt index b38119fe0..7e7935e46 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -1465,14 +1465,14 @@ examples/posix_spawn Requires: - CONFIG_BINFMT_DISABLE=n - Don't disable the binary loader - CONFIG_ELF=y - Enable ELF binary loader - CONFIG_LIBC_EXECFUNCS=y - Enable support for posix_spawn - CONFIG_EXECFUNCS_SYMTAB="exports" - The name of the symbol table - created by the test. - CONFIG_EXECFUNCS_NSYMBOLS=10 - Value does not matter, it will be - corrected at runtime. - CONFIG_POSIX_SPAWN_STACKSIZE=768 - This default setting. + CONFIG_BINFMT_DISABLE=n - Don't disable the binary loader + CONFIG_ELF=y - Enable ELF binary loader + CONFIG_LIBC_EXECFUNCS=y - Enable support for posix_spawn + CONFIG_EXECFUNCS_SYMTAB="g_exports" - The name of the symbol table + created by the test. + CONFIG_EXECFUNCS_NSYMBOLS=10 - Value does not matter, it will be + corrected at runtime. + CONFIG_POSIX_SPAWN_STACKSIZE=768 - This default setting. Test-specific configuration options: diff --git a/examples/nsh/Kconfig b/examples/nsh/Kconfig index ddaf4e680..0ccca54ad 100644 --- a/examples/nsh/Kconfig +++ b/examples/nsh/Kconfig @@ -30,6 +30,14 @@ config EXAMPLES_NSH_SYMTAB and g_nexports holds the number of entries in the application symbol table. + This is done very early in the NSH initialization sequence. + + Why might you want to do this? There is really only one reason: You + would like to have the symbol tables in place early so that programs + started by NSH, perhaps via an initialization script, will have all + of the necessary symbols in place. Otherwise, you probably do *not* + want this option! + config EXAMPLES_NSH_PROGNAME string "Program name" default "nsh" diff --git a/examples/nxflat/nxflat_main.c b/examples/nxflat/nxflat_main.c index cdd92337e..c559e82ef 100644 --- a/examples/nxflat/nxflat_main.c +++ b/examples/nxflat/nxflat_main.c @@ -233,7 +233,7 @@ int nxflat_main(int argc, char *argv[]) */ args[0] = NULL; - ret = exec(filename, args, exports, NEXPORTS); + ret = exec(filename, args, g_exports, NEXPORTS); if (ret < 0) { errmsg("ERROR: exec(%s) failed: %d\n", dirlist[i], errno); diff --git a/examples/nxflat/tests/mksymtab.sh b/examples/nxflat/tests/mksymtab.sh index 27abc4b41..b539c0d29 100755 --- a/examples/nxflat/tests/mksymtab.sh +++ b/examples/nxflat/tests/mksymtab.sh @@ -24,7 +24,7 @@ echo "#define __EXAMPLES_NXFLAT_TESTS_SYMTAB_H" echo "" echo "#include " echo "" -echo "static const struct symtab_s exports[] = " +echo "static const struct symtab_s g_exports[] = " echo "{" for string in $varlist; do @@ -33,7 +33,7 @@ for string in $varlist; do done echo "};" -echo "#define NEXPORTS (sizeof(exports)/sizeof(struct symtab_s))" +echo "#define NEXPORTS (sizeof(g_exports)/sizeof(struct symtab_s))" echo "" echo "#endif /* __EXAMPLES_NXFLAT_TESTS_SYMTAB_H */" diff --git a/examples/thttpd/content/mksymtab.sh b/examples/thttpd/content/mksymtab.sh index 4b5347f17..fc5af268e 100755 --- a/examples/thttpd/content/mksymtab.sh +++ b/examples/thttpd/content/mksymtab.sh @@ -24,7 +24,7 @@ echo "#define __EXAMPLES_NXFLAT_TESTS_SYMTAB_H" echo "" echo "#include " echo "" -echo "static const struct symtab_s exports[] = " +echo "static const struct symtab_s g_exports[] = " echo "{" for string in $varlist; do @@ -33,7 +33,7 @@ for string in $varlist; do done echo "};" -echo "#define NEXPORTS (sizeof(exports)/sizeof(struct symtab_s))" +echo "#define NEXPORTS (sizeof(g_exports)/sizeof(struct symtab_s))" echo "" echo "#endif /* __EXAMPLES_NXFLAT_TESTS_SYMTAB_H */" diff --git a/examples/thttpd/thttpd_main.c b/examples/thttpd/thttpd_main.c index 3a180e379..8b2ede52e 100644 --- a/examples/thttpd/thttpd_main.c +++ b/examples/thttpd/thttpd_main.c @@ -338,7 +338,7 @@ int thttp_main(int argc, char *argv[]) /* Start THTTPD. At present, symbol table info is passed via global variables */ #ifdef CONFIG_THTTPD_NXFLAT - g_thttpdsymtab = exports; + g_thttpdsymtab = g_exports; g_thttpdnsymbols = NEXPORTS; #endif