Size does matter: Extending the LLVM Linker for Fine-Granular Multivariant ELF Executables

In the ATLAS project, we explore the possibilities of address-space views which are synchronized variants of a process's address space that only differ in explicitly specified areas. Each thread can switch between the process's address-space views, thereby allowing context-based variation.

Address-space views can be used to facilitate run-time alterations of multi-threaded programs without the need of stopping the threads before modification. To facilitate this, we use an extension for the Executable and Linking Format (ELF) which allows embedding blueprints for address-space views that are based on pre-generated variants. The extension allows the developer to specify alternative code variants on the granularity of source files, which are then combined by the linker to produce a multivariant ELF.

This granularity, however, leads to non-functional drawbacks such as an increased image size or memory footprint by including code which is not multivariant on its own but part of the individual source code files and therefore all views. This ultimately results in the image incorporating multiple versions of the same non-multivariant functions even though their code is exactly the same.

The goal of this thesis is to shrink the granularity of multivariant views down to a function level by explicitly naming multivariant functions. Over the course of the thesis the student will develop a function marking mechanism as well as an extension to the LLVM linker to find and include multivariant code within the final ELF executable. They will test and evaluate the developed approach by applying it to synthetic test cases and real-world applications.