diff --git a/libs/libc/.gitignore b/libs/libc/.gitignore index 83663b26db..75a441eb21 100644 --- a/libs/libc/.gitignore +++ b/libs/libc/.gitignore @@ -2,6 +2,7 @@ /Make_ubin.dep /Make_kbin.dep /exec_symtab.c +/modlib_symtab.c /.depend /*.lib diff --git a/libs/libc/Makefile b/libs/libc/Makefile index 846752edfc..7142ba22b2 100644 --- a/libs/libc/Makefile +++ b/libs/libc/Makefile @@ -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 diff --git a/libs/libc/modlib/Kconfig b/libs/libc/modlib/Kconfig index a650ad019b..28b11e7f51 100644 --- a/libs/libc/modlib/Kconfig +++ b/libs/libc/modlib/Kconfig @@ -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