summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaxim <maxim@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2008-04-01 07:59:35 +0000
committermaxim <maxim@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2008-04-01 07:59:35 +0000
commitde15c7a167a5e8e776dda58d027c041fb092fd5d (patch)
tree47859cc415a7f04666d310338c943f7fb82582f6
parent8d8bb5a3373f654611b338c06459e6a6b1096dbd (diff)
downloadeglibc2-de15c7a167a5e8e776dda58d027c041fb092fd5d.tar.gz
Backport from trunk.
2008-03-28 Maxim Kuvyrkov <maxim@codesourcery.com> Explicitly get address of _DYNAMIC. * sysdeps/m68k/dl-machine.h (elf_machine_dynamic): Retrieve _DYNAMIC from GOT instead of assuming value at GOT pointer. git-svn-id: svn://svn.eglibc.org/branches/eglibc-2_5@5744 7b3dc134-2b1b-0410-93df-9e9f96275f8d
-rw-r--r--ports/ChangeLog.eglibc9
-rw-r--r--ports/sysdeps/m68k/dl-machine.h12
2 files changed, 16 insertions, 5 deletions
diff --git a/ports/ChangeLog.eglibc b/ports/ChangeLog.eglibc
index b7a957ae8..6c5b1ba2b 100644
--- a/ports/ChangeLog.eglibc
+++ b/ports/ChangeLog.eglibc
@@ -1,3 +1,12 @@
+2008-04-01 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ Backport from trunk.
+ 2008-03-28 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ Explicitly get address of _DYNAMIC.
+ * sysdeps/m68k/dl-machine.h (elf_machine_dynamic): Retrieve _DYNAMIC
+ from GOT instead of assuming value at GOT pointer.
+
2008-03-26 David Stephenson <david.stephenson@sicortex.com>
Daniel Jacobowitz <dan@codesourcery.com>
diff --git a/ports/sysdeps/m68k/dl-machine.h b/ports/sysdeps/m68k/dl-machine.h
index fad1ef9e0..08a439641 100644
--- a/ports/sysdeps/m68k/dl-machine.h
+++ b/ports/sysdeps/m68k/dl-machine.h
@@ -33,14 +33,16 @@ 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. */
+/* Return the link-time address of _DYNAMIC.
+ This must be inlined in a function which uses global data. */
static inline Elf32_Addr
elf_machine_dynamic (void)
{
- register Elf32_Addr *got asm ("%a5");
- return *got;
+ Elf32_Addr addr;
+
+ asm ("move.l _DYNAMIC@GOT.w(%%a5), %0"
+ : "=a" (addr));
+ return addr;
}