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-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.
+
2007-10-22 Daniel Jacobowitz <dan@codesourcery.com>
* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.
}
-/* 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;
}