diff options
| author | Jake Burkholder <jake@FreeBSD.org> | 2003-07-04 00:05:15 +0000 |
|---|---|---|
| committer | Jake Burkholder <jake@FreeBSD.org> | 2003-07-04 00:05:15 +0000 |
| commit | d03721348713ea143ba2919fd425e6f33a8126a6 (patch) | |
| tree | 859d240ec400844a7362d33581c44ad51def1e8f /libexec | |
| parent | 53dc6459d7d7dac5edafec8f57edf08428ec9fdf (diff) | |
Notes
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/rtld-elf/sparc64/rtld_machdep.h | 2 | ||||
| -rw-r--r-- | libexec/rtld-elf/sparc64/rtld_start.S | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/libexec/rtld-elf/sparc64/rtld_machdep.h b/libexec/rtld-elf/sparc64/rtld_machdep.h index 9efadcabaad9b..d92055c713817 100644 --- a/libexec/rtld-elf/sparc64/rtld_machdep.h +++ b/libexec/rtld-elf/sparc64/rtld_machdep.h @@ -37,7 +37,7 @@ struct Struct_Obj_Entry; /* Return the address of the .dynamic section in the dynamic linker. */ -#define rtld_dynamic(obj) ((Elf_Dyn *)(((char *)&_DYNAMIC) + (vm_offset_t)(obj)->relocbase)) +Elf_Dyn *rtld_dynamic(const struct Struct_Obj_Entry *); Elf_Addr reloc_jmpslot(Elf_Addr *, Elf_Addr, const struct Struct_Obj_Entry *, diff --git a/libexec/rtld-elf/sparc64/rtld_start.S b/libexec/rtld-elf/sparc64/rtld_start.S index f9d05b743f143..146c6314fc632 100644 --- a/libexec/rtld-elf/sparc64/rtld_start.S +++ b/libexec/rtld-elf/sparc64/rtld_start.S @@ -67,6 +67,23 @@ ENTRY(.rtld_start) mov %l0, %o0 END(.rtld_start) +/* + * Find the address of _DYNAMIC by disassembling a call instruction to it. + * Binutils may not fill in the GOT as expected on other architectures. + */ + +ENTRY(rtld_dynamic) + save %sp, -CCFSZ, %sp + call 1f + nop + call _DYNAMIC + 8 +1: lduw [%o7 + 8], %o0 + sll %o0, 2, %o0 + sra %o0, 0, %o0 + ret + restore %o0, %o7, %o0 +END(rtld_dynamic) + /* * We have two separate entry points to the runtime linker. * I'm implementing this following the SPARC v9 ABI spec. |
