ARMv7M ELF loader
FreeARMv7-M ELF loader for bare-metal and RTOS environments
About ARMv7M ELF loader
ARMv7M ELF loader is an open-source library designed to load and execute ELF binaries on ARMv7-M (Thumb-2) architecture, including Cortex-M and Cortex-R processors in Thumb2 mode. It operates over bare-metal or RTOS environments without requiring an MMU or special OS support, only relying on aligned memory allocation for minimal memory overhead. The loader handles two relocation types (R_ARM_ABS32 and R_ARM_THB_JMP/CALL) and recognizes custom memory sections such as .sdram_data, .sdram_rodata, and .sdram_bss. It provides a simple API including load_elf(), jumpTo(), get_func(), get_obj(), and unload_elf(). Developed with GCC ARM embedded and tested with Linaro toolchains, it requires ELF files compiled with specific flags (-fno-common, -mword-relocation, -r, -nostartfiles).
Key Features
Pros & Cons
- Minimal memory overhead due to loading only required ELF parts
- No MMU or special OS support required
- Simple and well-documented API
- Supports custom memory sections for flexible memory mapping
- Open source with permissive license
- Configurable I/O and memory management macros for portability
- Works with common ARM GCC toolchains
- Limited to ARMv7-M Thumb-2 architecture only
- Requires specific ELF compilation flags (-fno-common, -mword-relocation, etc.)
- Only handles two relocation types (R_ARM_ABS32 and R_ARM_THB_JMP/CALL)
- No support for common sections; all non-init data must be in bss
- Not a full-fledged operating system; loader only