nuttx/libs/libc/elf
yushuailong 166f17746c libc/elf: Always free the module symbol table on removal.
libelf_uninit() only called libelf_freesymtab() when the module had an
uninitializer.  But the exported symbol table is built by
libelf_insertsymtab() for every loaded module, and nothing in the tree
sets modinfo.uninitializer anymore:  modules have registered their
teardown through .fini_array since a9cb28cd23.  The condition is
therefore always false and every rmmod()/dlclose() leaks the exports
array together with the strdup-ed symbol names.

Call libelf_freesymtab() unconditionally, and clear the exports
pointers next to it instead of under a vestigial procfs guard that
dates back to the removed module initializer field.

Assisted-by: OpenAI Codex
Signed-off-by: yushuailong <yyyusl@qq.com>
2026-09-22 13:29:57 +08:00
..
CMakeLists.txt cmake: Use NUTTX(_DIR/_BIN_DIR) instead CMAKE(_SRC_DIR/_BIN_DIR) 2026-08-09 11:13:08 -03:00
elf.h libs/libc/elf: Place an FDPIC object's segments independently. 2026-09-08 16:31:16 -03:00
elf_addrenv.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_bind.c libs/libc/machine/arm: Relocate FDPIC function descriptors. 2026-09-13 16:03:32 -03:00
elf_depend.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_gethandle.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_getsymbol.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_globals.S
elf_init.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_insert.c libs/libc/elf: Fix the nxstyle errors around the FDPIC changes. 2026-09-08 16:31:16 -03:00
elf_iobuffer.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_load.c libs/libc/elf, binfmt: Describe the GOT by base and size, not by index. 2026-09-08 16:31:16 -03:00
elf_loadhdrs.c libs/libc/elf: Place an FDPIC object's segments independently. 2026-09-08 16:31:16 -03:00
elf_read.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_registry.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_remove.c libc/elf: Always free the module symbol table on removal. 2026-09-22 13:29:57 +08:00
elf_sections.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_symbols.c libs/libc/elf, binfmt: Describe the GOT by base and size, not by index. 2026-09-08 16:31:16 -03:00
elf_symtab.c
elf_uninit.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_unload.c libs/libc/elf: Place an FDPIC object's segments independently. 2026-09-08 16:31:16 -03:00
elf_verify.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
gnu-elf.ld.in arch/arm, libs/libc/elf: Build FDPIC modules in the normal ELF build. 2026-09-09 10:21:21 +08:00
Kconfig
Make.defs
Makefile