From: Steve Reinhardt Date: Thu, 16 Mar 2006 15:31:00 +0000 (-0500) Subject: Add warning for ignored loadable ELF segments. X-Git-Tag: m5_2.0_beta1~164^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=31a20c88c52f6051575fe760251407d11e5715ba;p=gem5.git Add warning for ignored loadable ELF segments. base/loader/elf_object.cc: Print warning if there are more than two loadable segments. We currently assume there are at most two (text & data), and that's held so far, but it would be nice not to silently ignore others. --HG-- extra : convert_revision : 1b3e693e95ba1210b09528b97819a7fa86426edc --- diff --git a/base/loader/elf_object.cc b/base/loader/elf_object.cc index 2925817cd..844a0bea8 100644 --- a/base/loader/elf_object.cc +++ b/base/loader/elf_object.cc @@ -75,8 +75,7 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data) DPRINTFR(Loader, "Not ELF\n"); elf_end(elf); return NULL; - } - else { + } else { //Detect the architecture //Versioning issues in libelf need to be resolved to get the correct //SPARC constants. @@ -213,8 +212,7 @@ ElfObject::ElfObject(const string &_filename, int _fd, bss.size = phdr.p_memsz - phdr.p_filesz; bss.baseAddr = phdr.p_vaddr + phdr.p_filesz; bss.fileImage = NULL; - } - else if (data.size == 0) { // have text, this must be data + } else if (data.size == 0) { // have text, this must be data data.baseAddr = phdr.p_vaddr; data.size = phdr.p_filesz; data.fileImage = fileData + phdr.p_offset; @@ -227,6 +225,10 @@ ElfObject::ElfObject(const string &_filename, int _fd, bss.size = phdr.p_memsz - phdr.p_filesz; bss.baseAddr = phdr.p_vaddr + phdr.p_filesz; bss.fileImage = NULL; + } else { + warn("More than two loadable segments in ELF object."); + warn("Ignoring segment @ 0x%x length 0x%x.", + phdr.p_vaddr, phdr.p_filesz); } }