This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PATCH: Update elf_machine_load_address for x32
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 14 May 2012 15:03:28 -0700
- Subject: PATCH: Update elf_machine_load_address for x32
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
This patch removes the `q' suffix from lea and replaces the .quad
directive with ASM_ADDR. Tested on Linu/x32 and Linux/x86-64. OK
to install?
H.J.
--
* sysdeps/x86_64/dl-machine.h (elf_machine_load_address): Remove
the `q' suffix from lea and replace .quad with ASM_ADDR.
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 32814b1..9c27ecf 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -72,10 +72,10 @@ elf_machine_load_address (void)
load offset which is zero if the binary was loaded at the address
it is prelinked for. */
- asm ("leaq _dl_start(%%rip), %0\n\t"
- "subq 1f(%%rip), %0\n\t"
+ asm ("lea _dl_start(%%rip), %0\n\t"
+ "sub 1f(%%rip), %0\n\t"
".section\t.data.rel.ro\n"
- "1:\t.quad _dl_start\n\t"
+ "1:\t" ASM_ADDR " _dl_start\n\t"
".previous\n\t"
: "=r" (addr) : : "cc");