summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2006-05-15 17:52:50 -0400
committerAli Saidi <saidi@eecs.umich.edu>2006-05-15 17:52:50 -0400
commit7d3eb0fe801add2bdbb05b482e7d7d303b6f386d (patch)
treeac86cd9f65d444b423655cd435ccc4dad808340c /base
parent0a053c7919cb13d216d85784577cbbd4539cd291 (diff)
parenta6266a99e26a23d3a2f52e05f3742984629c3786 (diff)
downloadgem5-7d3eb0fe801add2bdbb05b482e7d7d303b6f386d.tar.xz
Merge zizzer:/bk/newmem
into zeep.pool:/z/saidi/work/m5.newmem base/loader/elf_object.cc: removed SPARC32PLUS since it doesn't work. --HG-- extra : convert_revision : 620a1c75cdeefbeeb97383d92335cf319d9c9444
Diffstat (limited to 'base')
-rw-r--r--base/loader/elf_object.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/base/loader/elf_object.cc b/base/loader/elf_object.cc
index 9f30a1bbe..165501e1c 100644
--- a/base/loader/elf_object.cc
+++ b/base/loader/elf_object.cc
@@ -82,8 +82,7 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data)
//what it must be.
if (ehdr.e_machine == EM_SPARC64 ||
ehdr.e_machine == EM_SPARC ||
- ehdr.e_machine == EM_SPARCV9 ||
- ehdr.e_machine == EM_SPARC32PLUS) {
+ ehdr.e_machine == EM_SPARCV9) {
arch = ObjectFile::SPARC;
} else if (ehdr.e_machine == EM_MIPS
&& ehdr.e_ident[EI_CLASS] == ELFCLASS32) {
@@ -91,6 +90,7 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data)
} else if (ehdr.e_ident[EI_CLASS] == ELFCLASS64) {
arch = ObjectFile::Alpha;
} else {
+ warn("Unknown architecture: %d\n", ehdr.e_machine);
arch = ObjectFile::UnknownArch;
}
@@ -113,8 +113,7 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data)
//take a look at the .note.ABI section
//It can let us know what's what.
- if (opSys == ObjectFile::UnknownOpSys)
- {
+ if (opSys == ObjectFile::UnknownOpSys) {
Elf_Scn *section;
GElf_Shdr shdr;
Elf_Data *data;
@@ -125,7 +124,7 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data)
section = elf_getscn(elf, secIdx);
// While there are no more sections
- while (section != NULL) {
+ while (section != NULL && opSys == ObjectFile::UnknownOpSys) {
gelf_getshdr(section, &shdr);
if (shdr.sh_type == SHT_NOTE && !strcmp(".note.ABI-tag",
elf_strptr(elf, ehdr.e_shstrndx, shdr.sh_name))) {
@@ -148,6 +147,11 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data)
break;
}
} // if section found
+ if (!strcmp(".SUNW_version", elf_strptr(elf, ehdr.e_shstrndx, shdr.sh_name)))
+ opSys = ObjectFile::Solaris;
+ if (!strcmp(".stab.index", elf_strptr(elf, ehdr.e_shstrndx, shdr.sh_name)))
+ opSys = ObjectFile::Solaris;
+
section = elf_getscn(elf, ++secIdx);
} // while sections
}