summaryrefslogtreecommitdiff
path: root/base/loader
diff options
context:
space:
mode:
Diffstat (limited to 'base/loader')
-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 06c0ae663..58029bc3e 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.
@@ -215,8 +214,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;
@@ -229,6 +227,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);
}
}