walnux/libs/libc/modlib
Ville Juven e384a6a625 libs/modlib.c: Set VMA for empty and unallocated sections
This fixes issue where empty and unallocated sections are left without
a VMA. Some relocations depend on the section VMA being set even if there
is no data there, as the binary can refer to the symbols. Linker defined
symbols do not contain data -> they can produce empty sections.

This issue is seen when building a loadable file which declares _sctors /
_sdtors linker defined symbols for ctor/dtor sections which are empty.
crt0 references these symbols, so they need to be relocated, but the
section VMA is not set -> they go outside of the addressable range of the
user binary causing a potential crash.
2024-10-17 13:38:01 +08:00
..
CMakeLists.txt cmake:refine nuttx cmake build system fix CMake build missing part 2024-10-13 02:25:06 +08:00
gnu-elf.ld modlib:support modlib can load PIC elf 2024-10-16 18:40:06 +08:00
Kconfig libc/modlib: Make modlib selectable from defconfig 2024-10-16 10:11:20 +08:00
Make.defs modlib:Move addrenv logic to modlib 2024-10-12 12:29:06 +08:00
modlib.h modlib:move modlib_findsection to common headfile 2024-10-12 12:29:06 +08:00
modlib_addrenv.c modlib:Move addrenv logic to modlib 2024-10-12 12:29:06 +08:00
modlib_bind.c modlib:if elf in romfs/tmpfs, try use xipbase 2024-10-16 18:40:06 +08:00
modlib_depend.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
modlib_gethandle.c modlib/dlfcn:unify same code 2024-09-29 15:06:54 +08:00
modlib_getsymbol.c modlib/dlfcn:unify same code 2024-09-29 15:06:54 +08:00
modlib_globals.S libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
modlib_init.c modlib:Allow loading elf from block devices 2024-10-12 12:29:06 +08:00
modlib_insert.c modlib:so need export symbol, exec elf not need 2024-10-15 03:20:05 +08:00
modlib_iobuffer.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
modlib_load.c libs/modlib.c: Set VMA for empty and unallocated sections 2024-10-17 13:38:01 +08:00
modlib_loadhdrs.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
modlib_read.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
modlib_registry.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
modlib_remove.c modlib:if elf in romfs/tmpfs, try use xipbase 2024-10-16 18:40:06 +08:00
modlib_sections.c binfmt/modlib: move modlib_sectname to public 2024-10-12 12:29:06 +08:00
modlib_symbols.c modlib:support modlib can load PIC elf 2024-10-16 18:40:06 +08:00
modlib_symtab.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
modlib_uninit.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
modlib_unload.c modlib:if elf in romfs/tmpfs, try use xipbase 2024-10-16 18:40:06 +08:00
modlib_verify.c modlib:support modlib can load exec 2024-10-12 12:29:06 +08:00