2015-05-13 13:52:56 +02:00
|
|
|
--- qemu-2.3.0/linux-user/elfload.c.orig 2014-12-09 14:45:42.000000000 +0000
|
|
|
|
+++ qemu-2.3.0/linux-user/elfload.c 2015-01-28 02:51:23.719000000 +0000
|
2015-03-23 03:57:55 +01:00
|
|
|
@@ -28,6 +28,8 @@
|
|
|
|
|
|
|
|
#define ELF_OSABI ELFOSABI_SYSV
|
|
|
|
|
|
|
|
+extern abi_ulong afl_entry_point, afl_start_code, afl_end_code;
|
|
|
|
+
|
|
|
|
/* from personality.h */
|
|
|
|
|
|
|
|
/*
|
2015-05-13 13:52:56 +02:00
|
|
|
@@ -1889,6 +1891,8 @@
|
2015-03-23 03:57:55 +01:00
|
|
|
info->brk = 0;
|
|
|
|
info->elf_flags = ehdr->e_flags;
|
|
|
|
|
|
|
|
+ if (!afl_entry_point) afl_entry_point = info->entry;
|
|
|
|
+
|
|
|
|
for (i = 0; i < ehdr->e_phnum; i++) {
|
|
|
|
struct elf_phdr *eppnt = phdr + i;
|
|
|
|
if (eppnt->p_type == PT_LOAD) {
|
2015-05-13 13:52:56 +02:00
|
|
|
@@ -1922,9 +1926,11 @@
|
2015-03-23 03:57:55 +01:00
|
|
|
if (elf_prot & PROT_EXEC) {
|
|
|
|
if (vaddr < info->start_code) {
|
|
|
|
info->start_code = vaddr;
|
|
|
|
+ if (!afl_start_code) afl_start_code = vaddr;
|
|
|
|
}
|
|
|
|
if (vaddr_ef > info->end_code) {
|
|
|
|
info->end_code = vaddr_ef;
|
|
|
|
+ if (!afl_end_code) afl_end_code = vaddr_ef;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (elf_prot & PROT_WRITE) {
|