about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarcus Shawcroft <marcus.shawcroft@linaro.org>2013-06-28 11:27:26 +0100
committerMarcus Shawcroft <marcus.shawcroft@linaro.org>2013-06-28 11:27:26 +0100
commited0257f7d3378ec4a72e297f0dcba5159f2dd138 (patch)
treefd9b28c7c7d7a9192fd0329dbac22733cef74c53
parent03ea4d9b6916857e3c2a021f55d2a853cb837398 (diff)
downloadglibc-ed0257f7d3378ec4a72e297f0dcba5159f2dd138.tar.gz
glibc-ed0257f7d3378ec4a72e297f0dcba5159f2dd138.tar.xz
glibc-ed0257f7d3378ec4a72e297f0dcba5159f2dd138.zip
[AArch64] Adjust elf_machine_dynamic to find _DYNAMIC via _GLOBAL_OFFSET_TABLE_
-rw-r--r--ports/ChangeLog.aarch645
-rw-r--r--ports/sysdeps/aarch64/dl-machine.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/ports/ChangeLog.aarch64 b/ports/ChangeLog.aarch64
index 25424bbc82..25276218e1 100644
--- a/ports/ChangeLog.aarch64
+++ b/ports/ChangeLog.aarch64
@@ -1,5 +1,10 @@
 2013-06-28  Marcus Shawcroft  <marcus.shawcroft@linaro.org>
 
+	* sysdeps/aarch64/dl-machine.h (elf_machine_dynamic): De-reference
+	_GLOBAL_OFFSET_TABLE_.
+
+2013-06-28  Marcus Shawcroft  <marcus.shawcroft@linaro.org>
+
 	* sysdeps/unix/sysv/linux/aarch64/getcontext.S (__getcontext): Simplify
 	oPSTATE initialization.
 
diff --git a/ports/sysdeps/aarch64/dl-machine.h b/ports/sysdeps/aarch64/dl-machine.h
index c91b0c42e0..71dd6b3894 100644
--- a/ports/sysdeps/aarch64/dl-machine.h
+++ b/ports/sysdeps/aarch64/dl-machine.h
@@ -36,8 +36,8 @@ elf_machine_matches_host (const ElfW(Ehdr) *ehdr)
 static inline ElfW(Addr) __attribute__ ((unused))
 elf_machine_dynamic (void)
 {
-  ElfW(Addr) addr = (ElfW(Addr)) &_DYNAMIC;
-  return addr;
+  extern const ElfW(Addr) _GLOBAL_OFFSET_TABLE_[] attribute_hidden;
+  return _GLOBAL_OFFSET_TABLE_[0];
 }
 
 /* Return the run-time load address of the shared object.  */