This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PATCH: Don't handle R_X86_64_RELATIVE64 in ld.so
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 10 May 2012 17:20:52 -0700
- Subject: PATCH: Don't handle R_X86_64_RELATIVE64 in ld.so
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
R_X86_64_RELATIVE64 will never be used in ld.so. This patch handles
R_X86_64_RELATIVE64 only if RTLD_BOOTSTRAP isn't defined. Tested on
Linux/x32 and Linux/x86-64. OK to install?
Thanks.
H.J.
---
* sysdeps/x86_64/dl-machine.h (elf_machine_rela_relative): Handle
R_X86_64_RELATIVE64 only if RTLD_BOOTSTRAP isn't defined.
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 14df797..9c27ecf 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -487,11 +487,13 @@ elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
void *const reloc_addr_arg)
{
ElfW(Addr) *const reloc_addr = reloc_addr_arg;
+#if !defined RTLD_BOOTSTRAP
/* l_addr + r_addend may be > 0xffffffff and R_X86_64_RELATIVE64
relocation updates the whole 64-bit entry. */
if (__builtin_expect (ELFW(R_TYPE) (reloc->r_info) == R_X86_64_RELATIVE64, 0))
*(Elf64_Addr *) reloc_addr = (Elf64_Addr) l_addr + reloc->r_addend;
else
+#endif
{
assert (ELFW(R_TYPE) (reloc->r_info) == R_X86_64_RELATIVE);
*reloc_addr = l_addr + reloc->r_addend;