Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
|
|
Currently signal handler would call exit() only on second received
signal, this prevent proper program cleanup.
Instead use signal flag to exit loop.
Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
|
|
Signed-off-by: Abraham Gonzalez <abe.j.gonza@gmail.com>
|
|
It caused compile error "use of undeclared identifier 'errno'" at line 26 and 33.
I Add #include <cerrno> in fesvr/elfloader.cc to fix error and compile successfully.
|
|
Also remove now duplicate definition for types.
|
|
This commit adds the *.pc files for Spike's simulation library,
enabling dynamic and static linking without the need to directly
reference Spike sources. Using Spike as a stand-alone library
provides an interesting option for developing tools
and applications based on Spike.
|
|
|
|
* This enables useful functionality in inheritors
|
|
* fesvr/debug_defines.h is removed
|
|
Compiling spike with gcc 13 (for example, included in Fedora 38
prerelease) fails with error:
In file included from fesvr/syscall.h:6,
from fesvr/syscall.cc:4:
fesvr/device.h:15:30: error: ‘uint64_t’ was not declared in this scope
15 | typedef std::function<void(uint64_t)> callback_t;
| ^~~~~~~~
This is due to a gcc header dependency change. See for reference:
https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
This commit explicitly adds the missing <cstdint> header inclusion
to fix this build failure.
Signed-off-by: Julien Olivain <ju.o@free.fr>
|
|
|
|
When populated, symbol_elfs are additional elf files that populate the
addr2symbol map in htif
|
|
|
|
|
|
|
|
|
|
|
|
inject args
|
|
Asserts (especially without a message) aren't human readable way of
error reporting. So, replace them by exceptions with messages with
errno string.
|
|
|
|
Signed-off-by: Jerry Zhao <jerryz123@berkeley.edu>
|
|
Delete the old branch and pull a new one, because of a wrong force push. Git is not as easy as I think.
Signed-off-by: gr816ox <50945677+gr816ox@users.noreply.github.com>
|
|
It's just dead code. (Dependences on headers are auto-generated as
`.d` files.)
|
|
|
|
chaining
This step is to ensure that removing config.h out of headers will not cause regressions.
|
|
|
|
|
|
Set target endianess in constructors
|
|
|
|
Signed-off-by: Jerin Joy <joy@rivosinc.com>
|
|
Suppressing these individually would add too much clutter.
|
|
|
|
|
|
code and emits an error message to help avoid unintentionally loading wrong elf.
|
|
It's nearly free to do so, because it's just virtual address space.
@davidbiancolin recently fell into this pit when using context_t with VCS.
|
|
the default target endian is always little endian:
- mmu::is_target_big_endian() return false
- sim_t::get_target_endianness() return memif_endianness_little
when RISCV_ENABLE_DUAL_ENDIAN macro is undefined
|
|
We don't actually need encoding.h, so don't include it.
|
|
Fixes regression introduced by 1fea2afbf46d2641d77f2db3d6108e0897431a84
Resolves #964
|
|
...which includes program loading.
|
|
They should cause bad behavior in target land rather than crashing the
simulator.
|
|
|
|
This replaces multiple uses of `std::vector::operator[]` where the
parameter is a constant `0` with the use of C++11's `std::vector::data`
method. This fixes the root cause of invalid memory accesses.
`std::vector::operator[]` is an unchecked memory access, and when the
buffers are zero-sized (that is the buffer container is empty) either
due to a 0 padding in the case of elfloader or NULL parameters to
syscalls where permitted, the unchecked access may cause an invalid
memory access. The use of `std::vector::data` is permitted even in such
a case, though the returned memory may not be dereferenced. The general
usage of the returned pointer is to pass to `memif_t`, which is careful
about 0-sized buffer accesses, and so passing the result of
`std::vector::data` is safe. This is theoretically a better access
pattern as it also avoids having the compiler to re-materialize the
pointer from the de-referenced location.
|
|
`std::vector::operator[]` does not perform a bounds check when accessing
the underlying memory. If the length of the padding is 0, this would
access an invalid memory location. Guard against this by ensuring that
we have any padding to apply by constant hoisting the length computation
and checking the value.
|
|
This simply uses clang-format to reflow the text of the macro, which
makes it easier to read and edit.
|
|
Precompiled headers were broken because they weren't compiled with
the same -fPIC setting as the rest of the code. Fix by just making
everything use -fPIC.
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
|
|
Was broken by #681.
|
|
|