diff --git a/fesvr/htif.cc b/fesvr/htif.cc index 89b92246..7abf8b42 100644 --- a/fesvr/htif.cc +++ b/fesvr/htif.cc @@ -7,6 +7,7 @@ #include "platform.h" #include "byteorder.h" #include "trap.h" +#include "../riscv/common.h" #include #include #include @@ -171,6 +172,21 @@ void htif_t::load_program() load_payload(payload, &dummy_entry); } + class nop_memif_t : public memif_t { + public: + nop_memif_t(htif_t* htif) : memif_t(htif), htif(htif) {} + void read(addr_t UNUSED addr, size_t UNUSED len, void UNUSED *bytes) override {} + void write(addr_t UNUSED taddr, size_t UNUSED len, const void UNUSED *src) override {} + private: + htif_t* htif; + } nop_memif(this); + + reg_t nop_entry; + for (auto &s : symbol_elfs) { + std::map other_symbols = load_elf(s.c_str(), &nop_memif, &nop_entry, + expected_xlen); + symbols.merge(other_symbols); + } for (auto i : symbols) { auto it = addr2symbol.find(i.second); diff --git a/fesvr/htif.h b/fesvr/htif.h index 18ba7661..c6c0a9b9 100644 --- a/fesvr/htif.h +++ b/fesvr/htif.h @@ -99,6 +99,7 @@ class htif_t : public chunked_memif_t std::vector dynamic_devices; std::vector payloads; + std::vector symbol_elfs; std::map addr2symbol; friend class memif_t;