aboutsummaryrefslogtreecommitdiff
path: root/fesvr/elf.h
AgeCommit message (Collapse)AuthorFilesLines
2024-05-29add support to load ET_DYN elfClément Léger1-0/+2
When compiled as PIE, executable can be loaded at any memory address. Lately, OpenSBI switched to such behavior and spike was not able to load it anymore. This patch add an additional load_offset parameter for load_elf(). This load_offset value is passed as DRAM_BASE and used only for ET_DYN elfs. Signed-off-by: Clément Léger <cleger@rivosinc.com>
2020-10-10Fix new ELF checks on big endian hosts (#567)Marcus Comstedt1-4/+6
The new macros IS_ELF_... introduced in 80b5b2f5 were not endian safe.
2020-01-25Allow EM_NONE ELFs, tooAndrew Waterman1-0/+2
2020-01-25Refuse to load non-EXEC/non-RISC-V/non-V1 ELFs (#388)Alexander Lent1-0/+7
Stricter validation of ELF binaries improves usability with informative assertions. This prevents users from loading ELF relocatable files and binaries compiled for their (non-RISC-V) workstations, for example. Without this patch, spike would attempt to load nearly any ELF given, but it would usually fail with an error about debug module accesses, since the given ELF causes accesses in the debug module's memory space. Even if spike successfully loaded the ELF file, it would still misbehave during simulation, for example in the case of ELF relocatable files. ELF magic numbers come from official ELF documents: TIS ELF spec v1.2, via Linux Foundation Referenced Specifications See: https://refspecs.linuxbase.org/ RISC-V magic number comes from official RISC-V ELF documents: See: riscv/riscv-elf-psabi-doc@60c25981b62c0b43d16142f8a12c8b1e98e60d4d
2019-10-28Implement support for big-endian hostsMarcus Comstedt1-0/+2
2019-03-31Add fesvr; only globally install fesvr headers/libsstatic-linkAndrew Waterman1-0/+121