diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2009-02-15 23:43:39 -0800 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2009-02-15 23:43:39 -0800 |
commit | 6923282fb5a9ba6af14d19be094839eefe1c34be (patch) | |
tree | c009d33ccdde3ceb63225d0c8561918c8f8c25e4 /src/base | |
parent | e0f425bb94a5b67c1128cc05c490dc78f0841290 (diff) | |
download | gem5-6923282fb5a9ba6af14d19be094839eefe1c34be.tar.xz |
X86: Make the loader recognize 32 bit x86 processes.
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/loader/elf_object.cc | 8 | ||||
-rw-r--r-- | src/base/loader/object_file.hh | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc index edaf323c7..16fc698dd 100644 --- a/src/base/loader/elf_object.cc +++ b/src/base/loader/elf_object.cc @@ -89,10 +89,10 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data) } } else if (ehdr.e_machine == EM_X86_64 && ehdr.e_ident[EI_CLASS] == ELFCLASS64) { - //In the future, we might want to differentiate between 32 bit - //and 64 bit x86 processes in case there are differences in their - //initial stack frame. - arch = ObjectFile::X86; + arch = ObjectFile::X86_64; + } else if (ehdr.e_machine == EM_386 && + ehdr.e_ident[EI_CLASS] == ELFCLASS32) { + arch = ObjectFile::I386; } else if (ehdr.e_ident[EI_CLASS] == ELFCLASS64) { arch = ObjectFile::Alpha; } else if (ehdr.e_machine == EM_ARM) { diff --git a/src/base/loader/object_file.hh b/src/base/loader/object_file.hh index cc806ca81..d363cde84 100644 --- a/src/base/loader/object_file.hh +++ b/src/base/loader/object_file.hh @@ -50,7 +50,8 @@ class ObjectFile SPARC64, SPARC32, Mips, - X86, + X86_64, + I386, Arm }; |