Overview of gen-elf
maingen-elf is a utility for generating ELF files (Shared Objects and Relocatable Objects) specifically designed for testing ELF loaders. It allows developers to create binaries with specific symbol structures, relocation entries, and memory layouts to verify the correctness of elf_loader implementations.
Key Features
- Multi-architecture Support: x86_64, x86, Aarch64, Riscv64, Riscv32, Arm, and Loongarch64.
- Dynamic Library Generation: Creates Shared Objects (.so) with
.dynamicsections, relocation tables (RELA/REL), symbol tables, and GOT/PLT. - TLS and IFUNC Support: Supports Thread-Local Storage (TLS) symbols and Indirect Functions (IFUNC) with automatic resolver generation.
- Relocatable Object Generation: Creates standard relocatable object files (.o).
- Customizable Layout: Configure base address and page size for memory mapping tests.
- Metadata Export: Exports detailed relocation information and section addresses alongside the ELF data for easy verification in tests.