summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-10-12 20:10:10 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-10-12 20:10:10 -0700
commitac27bc7878700bb417784b202c5b6bc929092bc7 (patch)
tree9d56dec46d4da396da5fc71d96df0f796274007e /src
parentf6e5b92d639a51a25cbb72f90a831d9dfa75df3b (diff)
downloadgem5-ac27bc7878700bb417784b202c5b6bc929092bc7.tar.xz
Loader: Identify sections based on virtual addresses, and set the LoadAddrMask correctly for x86.
--HG-- extra : convert_revision : efa6cf42f7e69074c645dfcac335a3edf0941389
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/isa_traits.hh2
-rw-r--r--src/base/loader/elf_object.cc8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/arch/x86/isa_traits.hh b/src/arch/x86/isa_traits.hh
index 13fe9af4e..762f9b172 100644
--- a/src/arch/x86/isa_traits.hh
+++ b/src/arch/x86/isa_traits.hh
@@ -136,7 +136,7 @@ namespace X86ISA
StaticInstPtr decodeInst(ExtMachInst);
- const Addr LoadAddrMask = ULL(0xffffffffff);
+ const Addr LoadAddrMask = ULL(-1);
};
#endif // __ARCH_X86_ISATRAITS_HH__
diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc
index 653088c44..23df1c5ba 100644
--- a/src/base/loader/elf_object.cc
+++ b/src/base/loader/elf_object.cc
@@ -270,13 +270,13 @@ ElfObject::ElfObject(const string &_filename, int _fd,
}
// Check to see if this is the text or data segment
- if (phdr.p_paddr <= textSecStart &&
- phdr.p_paddr + phdr.p_filesz > textSecStart) {
+ if (phdr.p_vaddr <= textSecStart &&
+ phdr.p_vaddr + phdr.p_filesz > textSecStart) {
text.baseAddr = phdr.p_paddr;
text.size = phdr.p_filesz;
text.fileImage = fileData + phdr.p_offset;
- } else if (phdr.p_paddr <= dataSecStart &&
- phdr.p_paddr + phdr.p_filesz > dataSecStart) {
+ } else if (phdr.p_vaddr <= dataSecStart &&
+ phdr.p_vaddr + phdr.p_filesz > dataSecStart) {
data.baseAddr = phdr.p_paddr;
data.size = phdr.p_filesz;
data.fileImage = fileData + phdr.p_offset;