summaryrefslogtreecommitdiff
path: root/ldso/ldso/riscv64/dl-sysdep.h
diff options
context:
space:
mode:
Diffstat (limited to 'ldso/ldso/riscv64/dl-sysdep.h')
-rw-r--r--ldso/ldso/riscv64/dl-sysdep.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/ldso/ldso/riscv64/dl-sysdep.h b/ldso/ldso/riscv64/dl-sysdep.h
index 91a45af46..01f3e49bf 100644
--- a/ldso/ldso/riscv64/dl-sysdep.h
+++ b/ldso/ldso/riscv64/dl-sysdep.h
@@ -58,23 +58,20 @@ unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
|| (__WORDSIZE == 64 && (type) == R_RISCV_TLS_TPREL64))) \
| (ELF_RTYPE_CLASS_COPY * ((type) == R_RISCV_COPY)))
-
-/* Return the link-time address of _DYNAMIC. */
+/* Return the run-time load address of the shared object. */
static inline ElfW(Addr)
-elf_machine_dynamic (void)
+elf_machine_load_address (void)
{
- extern ElfW(Addr) _GLOBAL_OFFSET_TABLE_ __attribute__ ((visibility ("hidden")));
- return _GLOBAL_OFFSET_TABLE_;
+ extern const ElfW(Ehdr) __ehdr_start attribute_hidden;
+ return (ElfW(Addr)) &__ehdr_start;
}
-
-/* Return the run-time load address of the shared object. */
-static __always_inline ElfW(Addr) __attribute__ ((unused))
-elf_machine_load_address (void)
+/* Return the link-time address of _DYNAMIC. */
+static inline ElfW(Addr)
+elf_machine_dynamic (void)
{
- ElfW(Addr) load_addr;
- __asm__ ("lla %0, _DYNAMIC" : "=r" (load_addr));
- return load_addr - elf_machine_dynamic ();
+ extern ElfW(Dyn) _DYNAMIC[] attribute_hidden;
+ return (ElfW(Addr)) _DYNAMIC - elf_machine_load_address ();
}
static __always_inline void