diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2016-07-11 10:39:30 +0100 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2016-07-11 10:39:30 +0100 |
commit | 30cae3c21306b3942256e91a34525f9b83f99c3a (patch) | |
tree | c0fde3957df891d5176bf994c185ce31e1081acd /src/base/loader | |
parent | f4cc3a4d20865f5b80951ab800784f7ad54fc312 (diff) | |
download | gem5-30cae3c21306b3942256e91a34525f9b83f99c3a.tar.xz |
base: Convert ELF .text size check assertion to a warning
The ELF loader currently has an assertion that checks if the size of a
loaded .text secion is non-zero. This is useful in the general case as
an empty text section normally indicates that there is something
strange with the ELF file. However, asserting isn't very useful. This
changeset converts the assert into a warning that tells the user that
something strange is happening.
Change-Id: I313e17847b50a0eca00f6bd00a54c610d626c0f0
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Diffstat (limited to 'src/base/loader')
-rw-r--r-- | src/base/loader/elf_object.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc index 73c1c5dcd..410cc1fde 100644 --- a/src/base/loader/elf_object.cc +++ b/src/base/loader/elf_object.cc @@ -383,7 +383,9 @@ ElfObject::ElfObject(const std::string &_filename, size_t _len, } // should have found at least one loadable segment - assert(text.size != 0); + warn_if(text.size != 0, + "Empty .text segment in '%s'. ELF file corrupted?\n", + filename); DPRINTFR(Loader, "text: 0x%x %d\ndata: 0x%x %d\nbss: 0x%x %d\n", text.baseAddr, text.size, data.baseAddr, data.size, |