mirror of
git://sourceware.org/git/glibc.git
synced 2024-12-21 04:31:04 +08:00
(elf_machine_load_address): Compute the difference between base address and
first PT_LOAD's virtual address, not the base address.
This commit is contained in:
parent
177ac300b9
commit
8755441d32
@ -70,16 +70,20 @@ elf_machine_load_address (void)
|
|||||||
Elf64_Addr dot;
|
Elf64_Addr dot;
|
||||||
long int zero_disp;
|
long int zero_disp;
|
||||||
|
|
||||||
asm("br %0, 1f\n\t"
|
asm("br %0, 1f\n"
|
||||||
".weak __load_address_undefined\n\t"
|
"0:\n\t"
|
||||||
"br $0, __load_address_undefined\n"
|
"br $0, 2f\n"
|
||||||
"1:"
|
"1:\n\t"
|
||||||
|
".data\n"
|
||||||
|
"2:\n\t"
|
||||||
|
".quad 0b\n\t"
|
||||||
|
".previous"
|
||||||
: "=r"(dot));
|
: "=r"(dot));
|
||||||
|
|
||||||
zero_disp = *(int *)dot;
|
zero_disp = *(int *) dot;
|
||||||
zero_disp = (zero_disp << 43) >> 41;
|
zero_disp = (zero_disp << 43) >> 41;
|
||||||
|
|
||||||
return dot + 4 + zero_disp;
|
return dot - *(Elf64_Addr *) (dot + 4 + zero_disp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set up the loaded object described by L so its unrelocated PLT
|
/* Set up the loaded object described by L so its unrelocated PLT
|
||||||
|
Loading…
Reference in New Issue
Block a user