sail-riscv
sail-riscv copied to clipboard
Add DYN (Position-Independent Executable file) support
add a -d parameter for DYN files. Then give a offset, mostly 0x80000000 like openSBI.
Test Results
2 101 tests ±0 2 101 ✅ ±0 18m 3s ⏱️ +5s 1 suites ±0 0 💤 ±0 1 files ±0 0 ❌ ±0
Results for commit 1560d176. ± Comparison against base commit 87eb6fb8.
:recycle: This comment has been updated with latest results.
I prefer and suggest we keep the -d option reserved for debug mode, and use a different one for this PR.
I prefer and suggest we keep the
-doption reserved for debug mode, and use a different one for this PR.
which char do you like?
In the other PR to update the CLI we've removed short options so when you rebase on that I'd just remove it.
Also I don't think having a single flag actually works because we support loading multiple elfs. We might need some syntax like foo.elf@0x100 bar.elf@0x400.
Convert to draft since it needs https://github.com/riscv/sail-riscv/pull/1177 merging.
Do we still need this pr? @Timmmm
Yes, if we want to support loading executables at arbitrary offsets. I don't know how much demand there is for that though. What was the original motivation for this?
I think the original motivation was loading the default OpenSBI payload.
If I'm understanding this correctly (not a sure thing), the dynamic part lets the Sail model load ELFs at addresses that are in .json files, as opposed to some fixed address. The .S files should themselves be position independent (because they need to be run. We want that capability so that we can configure the Sail model to match what a DUT is actually executing (so exceptions report exactly the same EPC and TVAL, etc)
I think the original motivation was loading the default OpenSBI payload.
That's correct.