summary refs log tree commit diff stats
path: root/results/classifier/gemma3:12b/files/1830415
blob: d519f8bcc2ca9a42afc17913f70e170087286123 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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.