summaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/base')
-rw-r--r--src/base/loader/elf_object.cc9
-rw-r--r--src/base/loader/object_file.hh3
2 files changed, 9 insertions, 3 deletions
diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc
index d59affe85..b56dc5aa6 100644
--- a/src/base/loader/elf_object.cc
+++ b/src/base/loader/elf_object.cc
@@ -78,9 +78,14 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data)
//just assume if it wasn't something else and it's 64 bit, that's
//what it must be.
if (ehdr.e_machine == EM_SPARC64 ||
- ehdr.e_machine == EM_SPARC ||
+ (ehdr.e_machine == EM_SPARC &&
+ ehdr.e_ident[EI_CLASS] == ELFCLASS64)||
ehdr.e_machine == EM_SPARCV9) {
- arch = ObjectFile::SPARC;
+ arch = ObjectFile::SPARC64;
+ } else if (ehdr.e_machine == EM_SPARC32PLUS ||
+ (ehdr.e_machine == EM_SPARC &&
+ ehdr.e_ident[EI_CLASS] == ELFCLASS32)) {
+ arch = ObjectFile::SPARC32;
} else if (ehdr.e_machine == EM_MIPS
&& ehdr.e_ident[EI_CLASS] == ELFCLASS32) {
arch = ObjectFile::Mips;
diff --git a/src/base/loader/object_file.hh b/src/base/loader/object_file.hh
index 18e6482be..49c7363e6 100644
--- a/src/base/loader/object_file.hh
+++ b/src/base/loader/object_file.hh
@@ -47,7 +47,8 @@ class ObjectFile
enum Arch {
UnknownArch,
Alpha,
- SPARC,
+ SPARC64,
+ SPARC32,
Mips
};