diff options
author | Nathan Binkert <binkertn@umich.edu> | 2005-06-03 21:47:30 -0400 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2005-06-03 21:47:30 -0400 |
commit | 372b5e706ce8258cdcf68825901f2d5f2f2ee87e (patch) | |
tree | 61d6062a033a0f94e37ea430dde04dd91a9a977d | |
parent | af3add2e331fd1c77b5c83b65bcc7ba30d831ac8 (diff) | |
download | gem5-372b5e706ce8258cdcf68825901f2d5f2f2ee87e.tar.xz |
Make m5.fast work
base/loader/elf_object.cc:
elf_version is an odd function. Don't use assert since it
has a necessary side effect.
--HG--
extra : convert_revision : 8c48f91afe6c7ff5030ac1a534dcda7e2e0c5c57
-rw-r--r-- | base/loader/elf_object.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/base/loader/elf_object.cc b/base/loader/elf_object.cc index 6dfbce28c..d434d199d 100644 --- a/base/loader/elf_object.cc +++ b/base/loader/elf_object.cc @@ -58,7 +58,8 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data) GElf_Ehdr ehdr; // check that header matches library version - assert(elf_version(EV_CURRENT) != EV_NONE); + if (elf_version(EV_CURRENT) == EV_NONE) + panic("wrong elf version number!"); // get a pointer to elf structure elf = elf_memory((char*)data,len); @@ -97,7 +98,8 @@ ElfObject::ElfObject(const string &_filename, int _fd, GElf_Ehdr ehdr; // check that header matches library version - assert(elf_version(EV_CURRENT) != EV_NONE); + if (elf_version(EV_CURRENT) == EV_NONE) + panic("wrong elf version number!"); // get a pointer to elf structure elf = elf_memory((char*)fileData,len); @@ -205,7 +207,8 @@ ElfObject::loadSomeSymbols(SymbolTable *symtab, int binding) return false; // check that header matches library version - assert(elf_version(EV_CURRENT) != EV_NONE); + if (elf_version(EV_CURRENT) == EV_NONE) + panic("wrong elf version number!"); // get a pointer to elf structure elf = elf_memory((char*)fileData,len); |