summaryrefslogtreecommitdiff
path: root/base/loader/elf_object.cc
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2006-03-16 10:31:00 -0500
committerSteve Reinhardt <stever@eecs.umich.edu>2006-03-16 10:31:00 -0500
commit31a20c88c52f6051575fe760251407d11e5715ba (patch)
tree5dbf463a6c6a2d0faf913452f8291fc84f1b288d /base/loader/elf_object.cc
parent7359e2df01fde9ea34a0ba661750a455e26bcacd (diff)
downloadgem5-31a20c88c52f6051575fe760251407d11e5715ba.tar.xz
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
Diffstat (limited to 'base/loader/elf_object.cc')
-rw-r--r--base/loader/elf_object.cc10
1 files changed, 6 insertions, 4 deletions
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);
}
}