apps/examples: Fix some name collisions of both module and sotest examples are enabled.
This commit is contained in:
parent
08b6e087bf
commit
32211e21b6
@ -50,7 +50,7 @@ STACKSIZE = 2048
|
||||
# Module Example
|
||||
|
||||
ASRCS =
|
||||
CSRCS = symtab.c
|
||||
CSRCS = mod_symtab.c
|
||||
MAINSRC = module_main.c
|
||||
|
||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||
|
2
examples/module/drivers/.gitignore
vendored
2
examples/module/drivers/.gitignore
vendored
@ -1,5 +1,5 @@
|
||||
/romfs
|
||||
/romfs.h
|
||||
/romfs.img
|
||||
/symtab.c
|
||||
/mod_symtab.c
|
||||
|
||||
|
@ -45,7 +45,7 @@ DRIVER_DIR = $(MODULE_DIR)/drivers
|
||||
ROMFS_DIR = $(DRIVER_DIR)/romfs
|
||||
ROMFS_IMG = $(DRIVER_DIR)/romfs.img
|
||||
ROMFS_HDR = $(DRIVER_DIR)/romfs.h
|
||||
SYMTAB_SRC = $(DRIVER_DIR)/symtab.c
|
||||
SYMTAB_SRC = $(DRIVER_DIR)/mod_symtab.c
|
||||
|
||||
define DIR_template
|
||||
$(1)_$(2):
|
||||
|
@ -38,7 +38,7 @@ for var in $varlist; do
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "const struct symtab_s exports[] = "
|
||||
echo "const struct symtab_s mod_exports[] = "
|
||||
echo "{"
|
||||
|
||||
for var in $varlist; do
|
||||
@ -47,5 +47,5 @@ done
|
||||
|
||||
echo "};"
|
||||
echo ""
|
||||
echo "const int nexports = sizeof(exports) / sizeof(struct symtab_s);"
|
||||
echo "const int mod_nexports = sizeof(mod_exports) / sizeof(struct symtab_s);"
|
||||
|
||||
|
@ -106,8 +106,8 @@ static const char g_write_string[] = "Hi there, installed driver\n";
|
||||
* Symbols from Auto-Generated Code
|
||||
****************************************************************************/
|
||||
|
||||
extern const struct symtab_s exports[];
|
||||
extern const int nexports;
|
||||
extern const struct symtab_s mod_exports[];
|
||||
extern const int mod_nexports;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@ -132,8 +132,8 @@ int module_main(int argc, char *argv[])
|
||||
|
||||
/* Set the OS symbol table indirectly through the boardctl() */
|
||||
|
||||
symdesc.symtab = (FAR struct symtab_s *)exports;
|
||||
symdesc.nsymbols = nexports;
|
||||
symdesc.symtab = (FAR struct symtab_s *)mod_exports;
|
||||
symdesc.nsymbols = mod_nexports;
|
||||
ret = boardctl(BOARDIOC_OS_SYMTAB, (uintptr_t)&symdesc);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ STACKSIZE = 2048
|
||||
# Shared Library Example
|
||||
|
||||
ASRCS =
|
||||
CSRCS = symtab.c
|
||||
CSRCS = sot_symtab.c
|
||||
MAINSRC = sotest_main.c
|
||||
|
||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||
|
2
examples/sotest/lib/.gitignore
vendored
2
examples/sotest/lib/.gitignore
vendored
@ -1,5 +1,5 @@
|
||||
/romfs
|
||||
/romfs.h
|
||||
/romfs.img
|
||||
/symtab.c
|
||||
/sot_symtab.c
|
||||
|
||||
|
@ -45,7 +45,7 @@ LIB_DIR = $(SOTEST_DIR)/lib
|
||||
ROMFS_DIR = $(LIB_DIR)/romfs
|
||||
ROMFS_IMG = $(LIB_DIR)/romfs.img
|
||||
ROMFS_HDR = $(LIB_DIR)/romfs.h
|
||||
SYMTAB_SRC = $(LIB_DIR)/symtab.c
|
||||
SYMTAB_SRC = $(LIB_DIR)/sot_symtab.c
|
||||
|
||||
define DIR_template
|
||||
$(1)_$(2):
|
||||
|
@ -38,7 +38,7 @@ for var in $varlist; do
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "const struct symtab_s exports[] = "
|
||||
echo "const struct symtab_s sot_exports[] = "
|
||||
echo "{"
|
||||
|
||||
for var in $varlist; do
|
||||
@ -47,5 +47,5 @@ done
|
||||
|
||||
echo "};"
|
||||
echo ""
|
||||
echo "const int nexports = sizeof(exports) / sizeof(struct symtab_s);"
|
||||
echo "const int sot_nexports = sizeof(sot_exports) / sizeof(struct symtab_s);"
|
||||
|
||||
|
@ -94,8 +94,8 @@
|
||||
* Symbols from Auto-Generated Code
|
||||
****************************************************************************/
|
||||
|
||||
extern const struct symtab_s exports[];
|
||||
extern const int nexports;
|
||||
extern const struct symtab_s sot_exports[];
|
||||
extern const int sot_nexports;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@ -118,7 +118,7 @@ int sotest_main(int argc, char *argv[])
|
||||
|
||||
/* Set the shared library symbol table */
|
||||
|
||||
ret = dlsymtab((FAR struct symtab_s *)exports, nexports);
|
||||
ret = dlsymtab((FAR struct symtab_s *)sot_exports, sot_nexports);
|
||||
if (ret < 0)
|
||||
{
|
||||
fprintf(stderr, "ERROR: dlsymtab failed: %d\n", ret);
|
||||
|
Loading…
x
Reference in New Issue
Block a user