aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@codesourcery.com>2006-05-30 15:18:49 +0000
committerDaniel Jacobowitz <dan@codesourcery.com>2006-05-30 15:18:49 +0000
commite8256668f37af6af3f72738f871cf2b2f0addf19 (patch)
tree1172cb5fbf44fee4181031e891d2b6c58f5549f7
parent023a0de155889342edede9c86fd53d051d85e577 (diff)
downloadglibc-e8256668f37af6af3f72738f871cf2b2f0addf19.tar.xz
glibc-e8256668f37af6af3f72738f871cf2b2f0addf19.zip
* sysdeps/arm/dl-machine.h (elf_machine_dynamic): Rewrite to load
_GLOBAL_OFFSET_TABLE_ explicitly.
-rw-r--r--ChangeLog.arm5
-rw-r--r--sysdeps/arm/dl-machine.h14
2 files changed, 15 insertions, 4 deletions
diff --git a/ChangeLog.arm b/ChangeLog.arm
index 097491f22e..a80313d1e6 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,5 +1,10 @@
2006-05-30 Daniel Jacobowitz <dan@codesourcery.com>
+ * sysdeps/arm/dl-machine.h (elf_machine_dynamic): Rewrite to load
+ _GLOBAL_OFFSET_TABLE_ explicitly.
+
+2006-05-30 Daniel Jacobowitz <dan@codesourcery.com>
+
* sysdeps/unix/sysv/linux/arm/kernel-features.h: Add conditionals
for __ASSUME_TRUNCATE64_SYSCALL, __ASSUME_MMAP2_SYSCALL,
__ASSUME_STAT64_SYSCALL, __ASSUME_FCNTL64, and
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
index f176ff1372..5347d8bdbc 100644
--- a/sysdeps/arm/dl-machine.h
+++ b/sysdeps/arm/dl-machine.h
@@ -46,13 +46,19 @@ elf_machine_matches_host (const Elf32_Ehdr *ehdr)
/* Return the link-time address of _DYNAMIC. Conveniently, this is the
- first element of the GOT. This must be inlined in a function which
- uses global data. */
+ first element of the GOT. We used to use the PIC register to do this
+ without a constant pool reference, but GCC 4.2 will use a pseudo-register
+ for the PIC base, so it may not be in r10. */
static inline Elf32_Addr __attribute__ ((unused))
elf_machine_dynamic (void)
{
- register Elf32_Addr *got asm ("r10");
- return *got;
+ Elf32_Addr dynamic;
+ asm ("ldr %0, 2f\n"
+ "1: add %0, pc, %0\n"
+ "b 3f\n"
+ "2: .word _GLOBAL_OFFSET_TABLE_ - (1b+8)\n"
+ "3:" : "=r" (dynamic));
+ return dynamic;
}