From 372b5e706ce8258cdcf68825901f2d5f2f2ee87e Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Fri, 3 Jun 2005 21:47:30 -0400 Subject: [PATCH] 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 --- base/loader/elf_object.cc | 9 ++++++--- 1 file 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); -- 2.30.2