libs/libc: Add CONFIG_MODLIB_SYSTEM_SYMTAB to generate the symbol table for dlopen/insmod.

This commit is contained in:
Xiang Xiao 2019-09-28 11:17:01 -06:00 committed by Gregory Nutt
parent 8e74365b96
commit 389ac36f20
3 changed files with 16 additions and 0 deletions

View File

@ -2,6 +2,7 @@
/Make_ubin.dep
/Make_kbin.dep
/exec_symtab.c
/modlib_symtab.c
/.depend
/*.lib

View File

@ -126,6 +126,17 @@ CSRCS += exec_symtab.c
endif
ifeq ($(CONFIG_MODLIB_SYSTEM_SYMTAB),y)
modlib_symtab.c : $(CSVFILES) $(MKSYMTAB)
$(Q) cat $(CSVFILES) | LC_ALL=C sort >$@.csv
$(Q) $(MKSYMTAB) $@.csv $@ $(CONFIG_MODLIB_SYMTAB_ARRAY) $(CONFIG_MODLIB_NSYMBOLS_VAR)
$(Q) rm -f $@.csv
CSRCS += modlib_symtab.c
endif
# REVISIT: Backslash causes problems in $(COBJS) target
DELIM := $(strip /)
BINDIR ?= bin

View File

@ -91,6 +91,10 @@ config MODLIB_NSYMBOLS_VAR
default "g_mod_nsymbols" if !EXECFUNCS_HAVE_SYMTAB
default EXECFUNCS_NSYMBOLS_VAR if EXECFUNCS_HAVE_SYMTAB
config MODLIB_SYSTEM_SYMTAB
bool "Generate the system symbol table"
default n
endif # MODLIB_HAVE_SYMTAB
endmenu # Module library configuration