Static Multivariant ELFs for Memory-Constrained Systems

In many embedded systems, RAM is often the constrained ressource a systems developer has to cope with. And while some plattforms support in-place execution from flash memory, it is often desirable or even necessary to copy the code into RAM. However, not all functions are required at the same time, especially if two functions are alternative implementations of the same functionality. For example, for an embedded radio firmware, each region (i.e., Japan, USA) requires different functions to handle the frequency spectrum.

In this thesis, we want to explore static multivariant overlays on the ELF level. For this, the developer supplies us with two (or more) alternative implementations of the same function in the form of two object files. During the linking process, our modified LLVM Linker (lld) will link those alternatives to the same virtual address but place them in different load segments.

At run-time, the an to-be-implemented overlay manager can be used to load different code overlays into the RAM. Since both function implementations reside at the same virtual address, all function pointers will remain valid. As stable function pointers across variants require padding bytes, the thesis should also explore different strategies to optimize the code layout (e.g., trampoline tables).


Required Skills