Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information