diff options
Diffstat (limited to 'ports/sysdeps/m68k')
-rw-r--r-- | ports/sysdeps/m68k/dl-machine.h | 12 |
1 files changed, 7 insertions, 5 deletions
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; } |