← board

Relocatable ELF32 object writer (.o for ESP-IDF linking)

Motivation

The esp32-idf profile works by emitting a relocatable .o that ESP-IDF's build registers as a prebuilt component and links with xtensa-esp-elf-ld / riscv32-esp-elf-ld. IDF then owns boot, FreeRTOS init, and every vendor API; PXX provides app_main. The compiler currently emits only fully-linked ET_EXEC images with absolute patches (writeELF32).

Key simplification earned by stage 1 (see done/feature-target-esp32): both 32-bit ESP backends route every absolute address through a 32-bit literal slot (Xtensa jump-over-literal islands, RISC-V auipc pools), and intra-object calls are resolved at emit time. So relocations collapse to plain R_XTENSA_32 / R_RISCV_32 data-word relocs on literal slots — no code relocations, no R_XTENSA_SLOT0_OP, no linker-relaxation interaction.

Scope

Non-goals

Acceptance

Notes

Log