fixes some elf load issue

This commit is contained in:
Eyck Jentzsch 2024-07-05 12:18:36 +02:00
parent fd303c8343
commit 24449f1c0f
3 changed files with 6 additions and 3 deletions

View File

@ -605,7 +605,8 @@ template <typename BASE, features_e FEAT> std::pair<uint64_t, bool> riscv_hart_m
for(const auto pseg : reader.segments) {
const auto fsize = pseg->get_file_size(); // 0x42c/0x0
const auto seg_data = pseg->get_data();
if(fsize > 0) {
const auto type = pseg->get_type();
if(type==1 && fsize > 0) {
auto res = this->write(iss::address_type::PHYSICAL, iss::access_type::DEBUG_WRITE, traits<BASE>::MEM,
pseg->get_physical_address(), fsize, reinterpret_cast<const uint8_t* const>(seg_data));
if(res != iss::Ok)

View File

@ -589,7 +589,8 @@ template <typename BASE> std::pair<uint64_t, bool> riscv_hart_msu_vp<BASE>::load
for(const auto pseg : reader.segments) {
const auto fsize = pseg->get_file_size(); // 0x42c/0x0
const auto seg_data = pseg->get_data();
if(fsize > 0) {
const auto type = pseg->get_type();
if(type==1 && fsize > 0) {
auto res = this->write(iss::address_type::PHYSICAL, iss::access_type::DEBUG_WRITE, traits<BASE>::MEM,
pseg->get_physical_address(), fsize, reinterpret_cast<const uint8_t* const>(seg_data));
if(res != iss::Ok)

View File

@ -676,7 +676,8 @@ template <typename BASE, features_e FEAT> std::pair<uint64_t, bool> riscv_hart_m
for(const auto pseg : reader.segments) {
const auto fsize = pseg->get_file_size(); // 0x42c/0x0
const auto seg_data = pseg->get_data();
if(fsize > 0) {
const auto type = pseg->get_type();
if(type==1 && fsize > 0) {
auto res = this->write(iss::address_type::PHYSICAL, iss::access_type::DEBUG_WRITE, traits<BASE>::MEM,
pseg->get_physical_address(), fsize, reinterpret_cast<const uint8_t* const>(seg_data));
if(res != iss::Ok)