[PATCH] Fix alpha elf_machine_load_address
Jakub Jelinek
jakub@redhat.com
Wed Sep 19 10:09:00 GMT 2001
Hi!
Alpha elf_machine_load_address computes l_map_start value (= Elf64_Ehdr
address), not l_addr. This means ld.so's first PT_LOAD segment p_vaddr must
be zero as elf_machine_load_address is put into _dl_rtld_map.l_addr.
Here is a patch which fixes it.
If you have better ideas how to compute it, please tell me.
2001-09-19 Jakub Jelinek <jakub@redhat.com>
* sysdeps/alpha/dl-machine.h (elf_machine_load_address): Compute the
difference between base address and first PT_LOAD's virtual address,
not the base address.
--- libc/sysdeps/alpha/dl-machine.h.jj Mon Sep 3 08:55:51 2001
+++ libc/sysdeps/alpha/dl-machine.h Wed Sep 19 11:21:20 2001
@@ -70,16 +70,20 @@ elf_machine_load_address (void)
Elf64_Addr dot;
long int zero_disp;
- asm("br %0, 1f\n\t"
- ".weak __load_address_undefined\n\t"
- "br $0, __load_address_undefined\n"
- "1:"
+ asm("br %0, 1f\n"
+ "0:\n\t"
+ "br $0, 2f\n"
+ "1:\n\t"
+ ".data\n"
+ "2:\n\t"
+ ".quad 0b\n\t"
+ ".previous"
: "=r"(dot));
zero_disp = *(int *)dot;
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
Jakub
More information about the Libc-hacker
mailing list