diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2024-03-17 18:01:24 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2024-03-19 14:50:57 +0100 |
commit | ae11f049fc55c63a79b95ce0de69a1aee0d53faf (patch) | |
tree | 81cadde791e058896cb87e996c215dc469916b83 /ldso/ldso/riscv64/dl-sysdep.h | |
parent | 9e7b342fde5505c0a1d4968e9d70537ac406f640 (diff) |
riscv64: sync with glibc, fix all TLS errors in uClibc-ng-test
Diffstat (limited to 'ldso/ldso/riscv64/dl-sysdep.h')
-rw-r--r-- | ldso/ldso/riscv64/dl-sysdep.h | 21 |
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 |