From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from port70.net (port70.net [81.7.13.123]) by sourceware.org (Postfix) with ESMTP id B87113858D33 for ; Sat, 6 Apr 2024 17:40:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B87113858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=port70.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=port70.net ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B87113858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=81.7.13.123 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712425220; cv=none; b=Gb9wdh5Ty3B0UgGeZxRNbnaPDsQsDmt0rL95tJv5WDDikM7jTAJC/OaV4104JW1iqSPXIgpmax9SJHPCwJ6MceVJEXu/kHYCa9dkTJNAsYNvLTKKlm8Z9sh0/JU5uFSH/yrokaubo0++hxqf5fDcBZOnPjGa/AFtiW0GApFxyv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712425220; c=relaxed/simple; bh=jI17LUkILyqnNr2GVpPVTYN6/rKtT3tSMXYowYHAq4Y=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=t/WRL+4j5crXD+ag0RDLnW7XwXFr1FlQQSvWNrVyu/F456zMLLZi3Tok6eIxtSCAndU5Mcvz0r9x3YF/bdRpveSSQ+DkD9aMzWfhw1qryMXebnzI+ki1kOSvRbjXF0WfUyCfKj1jSwvCSrl0BOR7I7k+wT3ArURnBM6sAyzJKGw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by port70.net (Postfix, from userid 1002) id 7F521ABEC0C7; Sat, 6 Apr 2024 19:40:16 +0200 (CEST) Date: Sat, 6 Apr 2024 19:40:16 +0200 From: Szabolcs Nagy To: Adhemerval Zanella Netto Cc: Szabolcs Nagy , libc-alpha@sourceware.org Subject: Re: [PATCH] aarch64: Remove ld.so __tls_get_addr plt usage Message-ID: <20240406174016.GD3766212@port70.net> References: <20240405123550.1748641-1-adhemerval.zanella@linaro.org> <0af468ae-bf65-4e20-8bd7-af85eba2e5d9@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0af468ae-bf65-4e20-8bd7-af85eba2e5d9@linaro.org> X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Adhemerval Zanella Netto [2024-04-05 13:29:48 -0300]: > > > On 05/04/24 11:58, Szabolcs Nagy wrote: > > The 04/05/2024 09:35, Adhemerval Zanella wrote: > >> Use the hidden alias instead. > >> > >> Checked on aarch64-linux-gnu. > > > > does this change behaviour in case __tls_get_addr is interposed? > > > > > > Do we support symbol interposition for symbols in implementation namespace? > If so, we will need to revert x86 to use the same semantic and document it > properly. i suspect this will partially break the sanitizers and possibly other similar tools that hook internals so i hoped at least for better commit msg pointing out that this is deliberate behaviour change. > > >> --- > >> sysdeps/aarch64/dl-tlsdesc.S | 3 ++- > >> sysdeps/unix/sysv/linux/aarch64/localplt.data | 2 -- > >> 2 files changed, 2 insertions(+), 3 deletions(-) > >> > >> diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S > >> index 9b253b39dd..4febf2ad21 100644 > >> --- a/sysdeps/aarch64/dl-tlsdesc.S > >> +++ b/sysdeps/aarch64/dl-tlsdesc.S > >> @@ -220,7 +220,7 @@ _dl_tlsdesc_dynamic: > >> SAVE_Q_REGISTERS > >> > >> mov x0, x1 > >> - bl __tls_get_addr > >> + bl HIDDEN_JUMPTARGET(__tls_get_addr) > >> > >> mrs x1, tpidr_el0 > >> sub PTR_REG (0), PTR_REG (0), PTR_REG (1) > >> @@ -246,5 +246,6 @@ _dl_tlsdesc_dynamic: > >> b 1b > >> cfi_endproc > >> .size _dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic > >> + .hidden HIDDEN_JUMPTARGET(__tls_get_addr) > >> # undef NSAVEXREGPAIRS > >> #endif > >> diff --git a/sysdeps/unix/sysv/linux/aarch64/localplt.data b/sysdeps/unix/sysv/linux/aarch64/localplt.data > >> index 5d217cc50d..5dd07472df 100644 > >> --- a/sysdeps/unix/sysv/linux/aarch64/localplt.data > >> +++ b/sysdeps/unix/sysv/linux/aarch64/localplt.data > >> @@ -9,5 +9,3 @@ libm.so: matherr > >> # If outline atomics are used, libgcc (built outside of glibc) may > >> # call __getauxval using the PLT. > >> libc.so: __getauxval ? > >> -# The dynamic loader needs __tls_get_addr for TLS. > >> -ld.so: __tls_get_addr > >> -- > >> 2.34.1 > >>