Add esp32c3-qemu exec elf support#441
Open
YinhuaChen-vivo wants to merge 6 commits into
Open
Conversation
loader: dispatch ELF loading by image type loader: validate segments and dynamic relocations loader: validate ELF widths and relocation alignment loader: correct 32-bit ELF width regression loader: add fixed-address RV32 EXEC fixture loader: run integration test on ESP32 QEMU loader: support fixed-address RISC-V EXEC images add print in loader/tests/inputs/exec_app/src/main.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add fixed-address RV32
ET_EXECloading support for ESP32-C3 while keeping theexisting position-independent
ET_DYNflow intact.The loader now selects the loading strategy from both the ELF type and the
mapper mode:
What changed
MemoryMapper, backed by caller-authorizedMemoryRegions and explicit read/write/execute permissions.ET_EXECimages.Loadable segments are preflighted before any memory is written, including
input bounds, address overflow, alignment, permissions, and executable-entry
checks.
ET_EXEC, and executefence.iafter installing code on RISC-V so the instruction stream observesthe newly loaded image.
ET_DYNpath with checked ELF integer conversions andrange arithmetic, explicit BSS zeroing, load-bias-aware relative
relocations, aligned writes, and rejection of unsupported dynamic
relocations.
memory at
0x50000000. The fixture verifies initialized data, zeroed BSS,and execution through the ELF entry point.
preserving the existing generic QEMU path and PIC ELF tests for other
targets.
Validation
The ESP32-C3 integration suite covers:
ET_EXECimage with an allocated mapper;Existing non-ESP32 integration tests continue to exercise the PIC/
ET_DYNpath and malformed ELF inputs.
Limitations
ET_EXECimages.ET_EXECimages must be fully static:PT_DYNAMICand runtime relocationsare not supported.
MemoryRegionfor its full lifetime and for avoiding conflicting accesses.