blob: e7754d59809e3a41e73face9779797238b95af90 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
files: 0.646
graphic: 0.569
semantic: 0.512
device: 0.505
performance: 0.495
other: 0.344
network: 0.288
boot: 0.247
vnc: 0.215
PID: 0.203
socket: 0.195
debug: 0.169
permissions: 0.133
KVM: 0.071
linux-user elf loader issue
all versions up to 4.0 (I didn't test others)
file affected linux-user/elfload.c
function load_elf_image
if (phdr[i].p_type == PT_LOAD) {
- abi_ulong a = phdr[i].p_vaddr - phdr[i].p_offset;
+ abi_ulong a = phdr[i].p_vaddr ; // - phdr[i].p_offset;
if (a < loaddr) {
loaddr = a;
To the best of my understanding of the elf format p_offset is not a virtual offset. In fact, when I load statically compiled applications, the load fails because the libc before main is trying to access phdr in the executable image but that memory is not mapped -- this is caused by the wrong loaddr above.
Have you got a test case? The check-tcg tests all pass and they are statically linked elfs.
[Expired for QEMU because there has been no activity for 60 days.]
|