diff options
Diffstat (limited to 'base/loader/object_file.cc')
-rw-r--r-- | base/loader/object_file.cc | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/base/loader/object_file.cc b/base/loader/object_file.cc index 7f46ae2fb..c6dfced1d 100644 --- a/base/loader/object_file.cc +++ b/base/loader/object_file.cc @@ -63,22 +63,16 @@ ObjectFile::~ObjectFile() bool -ObjectFile::loadSection(Section *sec, TranslatingPort *memPort, bool loadPhys) +ObjectFile::loadSection(Section *sec, Port *memPort, Addr addrMask) { if (sec->size != 0) { - Addr addr = sec->baseAddr; - if (loadPhys) { - // this is Alpha-specific... going to have to fix this - // for other architectures - addr &= (ULL(1) << 40) - 1; - } - + Addr addr = sec->baseAddr & addrMask; if (sec->fileImage) { - memPort->writeBlob(addr, sec->fileImage, sec->size, true); + memPort->writeBlob(addr, sec->fileImage, sec->size); } else { // no image: must be bss - memPort->memsetBlob(addr, 0, sec->size, true); + memPort->memsetBlob(addr, 0, sec->size); } } return true; @@ -86,11 +80,11 @@ ObjectFile::loadSection(Section *sec, TranslatingPort *memPort, bool loadPhys) bool -ObjectFile::loadSections(TranslatingPort *memPort, bool loadPhys) +ObjectFile::loadSections(Port *memPort, Addr addrMask) { - return (loadSection(&text, memPort, loadPhys) - && loadSection(&data, memPort, loadPhys) - && loadSection(&bss, memPort, loadPhys)); + return (loadSection(&text, memPort, addrMask) + && loadSection(&data, memPort, addrMask) + && loadSection(&bss, memPort, addrMask)); } |