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.
This commit is contained in:
Andreas Schwab 2008-03-28 12:23:06 +00:00
parent 285e04f887
commit 04d6ca32f1
2 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,9 @@
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.

View File

@ -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;
}