From 6bb2d37af6772cada51b0871d3184f7783779364 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 20 Mar 2024 09:44:40 +0100 Subject: riscv32: sync with riscv64 --- ldso/ldso/riscv32/elfinterp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ldso') diff --git a/ldso/ldso/riscv32/elfinterp.c b/ldso/ldso/riscv32/elfinterp.c index dc1ac994d..1a0d5d445 100644 --- a/ldso/ldso/riscv32/elfinterp.c +++ b/ldso/ldso/riscv32/elfinterp.c @@ -214,11 +214,11 @@ _dl_do_reloc (struct elf_resolve *tpnt, struct r_scope_elem *scope, *reloc_addr = tls_tpnt->l_tls_modid; break; case R_RISCV_TLS_DTPREL32: - *reloc_addr = symbol_addr + rpnt->r_addend; + *reloc_addr = symbol_addr -TLS_DTV_OFFSET + rpnt->r_addend; break; case R_RISCV_TLS_TPREL32: CHECK_STATIC_TLS ((struct link_map *) tls_tpnt); - *reloc_addr = tls_tpnt->l_tls_offset + symbol_addr + rpnt->r_addend - TLS_TCB_SIZE; + *reloc_addr = tls_tpnt->l_tls_offset + symbol_addr + rpnt->r_addend; break; #endif default: -- cgit v1.2.3