summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2006-03-16 18:39:54 -0500
committerKorey Sewell <ksewell@umich.edu>2006-03-16 18:39:54 -0500
commit805b9cf1d5ace9c02b7bd120ee1bc082f544699d (patch)
tree8cfa7fd94fac36023b4058cbf95d601327a57ac5 /base
parent77a2f97c3590d7d51ffc5b447546c7c70894bdbd (diff)
downloadgem5-805b9cf1d5ace9c02b7bd120ee1bc082f544699d.tar.xz
Found and fixed 3 decoder.isa bugs!!! Now the hello_world program runs for a while
before getting in a infinite loop. It actually "tries" to syscall too, but syscalls aren't implemented just yet arch/mips/faults.cc: more descriptive names for faults (will help future users as well as me!) arch/mips/isa/base.isa: make sure we are printing out "BasicOp" format disassembly instructions as dest,src,src instead of src,src,dest arch/mips/isa/decoder.isa: FIX LW/SW Bug!!!! I was actually loading a byte instead of a word FIX JALR Bug!!!! I was not saving the link address in R31 for this instruction FIX SLL/NOP Bug!!! We now recognize the varying flavors of sll,nop,ehb,& ssnop correctly base/loader/elf_object.cc: change back to original way base/loader/elf_object.hh: change back to original! --HG-- extra : convert_revision : 39b65fba31c1842ac6966346fe8a35816a4231fa
Diffstat (limited to 'base')
-rw-r--r--base/loader/elf_object.cc39
-rw-r--r--base/loader/elf_object.hh2
2 files changed, 3 insertions, 38 deletions
diff --git a/base/loader/elf_object.cc b/base/loader/elf_object.cc
index b9636b454..06c0ae663 100644
--- a/base/loader/elf_object.cc
+++ b/base/loader/elf_object.cc
@@ -157,48 +157,14 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data)
} // while sections
}
- int32_t global_ptr;
- if (arch == ObjectFile::Mips) {
- Elf_Scn *section;
- GElf_Shdr shdr;
- Elf_Data *rdata;
- int secIdx = 1;
-
- // Get the first section
- section = elf_getscn(elf, secIdx);
-
- // While there are no more sections
- while (section != NULL) {
- gelf_getshdr(section, &shdr);
- /*shdr.sh_type == SHT_MIPS_REGINFO && */
- if (!strcmp(".reginfo",elf_strptr(elf, ehdr.e_shstrndx, shdr.sh_name))) {
- // We have found MIPS reginfo section:
- // -------------------------------
- // Check the 6th 32bit word for the initialized global pointer value
- // -------------------------------
- rdata = elf_rawdata(section, NULL);
- assert(rdata->d_buf);
-
- if(ehdr.e_ident[EI_DATA] == ELFDATA2LSB)
- global_ptr = htole(((int32_t*)rdata->d_buf)[5]);
- else
- global_ptr = htobe(((int32_t*)rdata->d_buf)[5]);
- break;
- }
-
- section = elf_getscn(elf, ++secIdx);
- } // if section found
-
- }
-
elf_end(elf);
- return new ElfObject(fname, fd, len, data, global_ptr,arch, opSys);
+ return new ElfObject(fname, fd, len, data, arch, opSys);
}
}
ElfObject::ElfObject(const string &_filename, int _fd,
- size_t _len, uint8_t *_data,Addr global_ptr,
+ size_t _len, uint8_t *_data,
Arch _arch, OpSys _opSys)
: ObjectFile(_filename, _fd, _len, _data, _arch, _opSys)
@@ -222,7 +188,6 @@ ElfObject::ElfObject(const string &_filename, int _fd,
entry = ehdr.e_entry;
- globalPtr = global_ptr;
// initialize segment sizes to 0 in case they're not present
text.size = data.size = bss.size = 0;
diff --git a/base/loader/elf_object.hh b/base/loader/elf_object.hh
index d1fd32fd0..72c265edd 100644
--- a/base/loader/elf_object.hh
+++ b/base/loader/elf_object.hh
@@ -39,7 +39,7 @@ class ElfObject : public ObjectFile
bool loadSomeSymbols(SymbolTable *symtab, int binding);
ElfObject(const std::string &_filename, int _fd,
- size_t _len, uint8_t *_data,Addr global_ptr,
+ size_t _len, uint8_t *_data,
Arch _arch, OpSys _opSys);
public: