summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-10-09 13:12:04 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-10-09 13:12:04 -0700
commitf6e5b92d639a51a25cbb72f90a831d9dfa75df3b (patch)
treec974fe8eb05f432ad45e127e35b7846d4e0e050e
parenta630d77ec5cb208db5fe581f11ca2f7a01b3d7ce (diff)
downloadgem5-f6e5b92d639a51a25cbb72f90a831d9dfa75df3b.tar.xz
ELF Loader: Use physical addresses instead of virtual ones.
This works in SE mode because the virtual and physical addresses specified for segments are the same. In Alpha, the LoadAddrMask is still necessary because the virtual and physical addresses are the same and apparently rely on the super page mechanism. All of the regressions pass. --HG-- extra : convert_revision : 45e49dec5002d64e541bc466c61a0f304af29ea5
-rw-r--r--src/base/loader/elf_object.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc
index 553723e74..653088c44 100644
--- a/src/base/loader/elf_object.cc
+++ b/src/base/loader/elf_object.cc
@@ -176,7 +176,7 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data)
if(phdr.p_offset <= e_phoff &&
phdr.p_offset + phdr.p_filesz > e_phoff)
{
- result->_programHeaderTable = phdr.p_vaddr + e_phoff;
+ result->_programHeaderTable = phdr.p_paddr + e_phoff;
break;
}
}
@@ -261,28 +261,28 @@ ElfObject::ElfObject(const string &_filename, int _fd,
continue;
// Check to see if this segment contains the bss section.
- if (phdr.p_vaddr <= bssSecStart &&
- phdr.p_vaddr + phdr.p_memsz > bssSecStart &&
+ if (phdr.p_paddr <= bssSecStart &&
+ phdr.p_paddr + phdr.p_memsz > bssSecStart &&
phdr.p_memsz - phdr.p_filesz > 0) {
- bss.baseAddr = phdr.p_vaddr + phdr.p_filesz;
+ bss.baseAddr = phdr.p_paddr + phdr.p_filesz;
bss.size = phdr.p_memsz - phdr.p_filesz;
bss.fileImage = NULL;
}
// Check to see if this is the text or data segment
- if (phdr.p_vaddr <= textSecStart &&
- phdr.p_vaddr + phdr.p_filesz > textSecStart) {
- text.baseAddr = phdr.p_vaddr;
+ if (phdr.p_paddr <= textSecStart &&
+ phdr.p_paddr + phdr.p_filesz > textSecStart) {
+ text.baseAddr = phdr.p_paddr;
text.size = phdr.p_filesz;
text.fileImage = fileData + phdr.p_offset;
- } else if (phdr.p_vaddr <= dataSecStart &&
- phdr.p_vaddr + phdr.p_filesz > dataSecStart) {
- data.baseAddr = phdr.p_vaddr;
+ } else if (phdr.p_paddr <= dataSecStart &&
+ phdr.p_paddr + phdr.p_filesz > dataSecStart) {
+ data.baseAddr = phdr.p_paddr;
data.size = phdr.p_filesz;
data.fileImage = fileData + phdr.p_offset;
} else {
Segment extra;
- extra.baseAddr = phdr.p_vaddr;
+ extra.baseAddr = phdr.p_paddr;
extra.size = phdr.p_filesz;
extra.fileImage = fileData + phdr.p_offset;
extraSegments.push_back(extra);