From patchwork Tue Jul 4 20:28:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 21423 Received: (qmail 72856 invoked by alias); 4 Jul 2017 20:28:56 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 72709 invoked by uid 89); 4 Jul 2017 20:28:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-oi0-f41.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oTpRoTd0uXfEqUmFet4VdH6Px91WtPfhhPnVwyoGZr4=; b=gi1XEyFYy+fHvHK2RyFZ6oA0cZwWj1AlyiHWiJAT+L1khIqyE5fjjIUQ5TzI4JES1Y wP5DBvbMSO2WdVmBAhDeiqHjH4Vl18TCJn19dskj72tD3YBEcvSFOdGtJeSEesnZ5EpU 1OBMyMACJWppG6jZIfyOvBqvSf+y4DrJEaS7WXIFS35ccEABQCxIjVr/dSFuzXGsxNsK C/OTaDTN6KJsyRng/XpXzA0+NkyF6o0ylPRTxm4t0zDIRI1VtnSAtKsRVA57G7h+6cre mlUinzjz6UqBH2iP38ZOAJeaX0qQiu9uQp2e+aIm0Fbzffv1L5/B8vrA+MCgW4m9kh8A QhUA== X-Gm-Message-State: AKS2vOzuhyzYiVjulXSXhTvXuTOKwh04IOX6yBbxNrWFI23M9w0VdOOP mZ0oHc5dUZqgXugm78hNbx5uH7JFcQ== X-Received: by 10.202.192.193 with SMTP id q184mr21769491oif.179.1499200131613; Tue, 04 Jul 2017 13:28:51 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <14a88e5f-a8c6-cd78-a363-1368d175f605@redhat.com> <20170703202551.GA17398@gmail.com> <3e579057-ebc3-a407-40c2-3956a017ff4e@redhat.com> <9266eaa7-4bf3-816a-1f9c-616be12b3502@redhat.com> From: "H.J. Lu" Date: Tue, 4 Jul 2017 13:28:50 -0700 Message-ID: Subject: Re: [PATCH] x86-64: Align the stack in __tls_get_addr [BZ #21609] To: Florian Weimer Cc: GNU C Library , Nicholas Miell , Jakub Jelinek On Tue, Jul 4, 2017 at 1:16 PM, Florian Weimer wrote: > On 07/04/2017 06:25 PM, H.J. Lu wrote: >> Something like this. > > Sorry, I lost track of the patches. > > Would you please post the two patches you propose to apply? > Here are 2 patches. From b59d4b240c18673a9018e338702e51536d6f25d2 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 4 Jul 2017 09:24:09 -0700 Subject: [PATCH 2/2] x86-64: Export ___tls_get_addr On x86-64, __tls_get_addr is changed to realign stack to support GCC older than GCC 4.9.4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066 This patch exports ___tls_get_addr as the alternative x86-64 runtime interface to TLS with aligned stack. This requires linker support for TLS optimization with ___tls_get_addr. The GCC 4.9.4 and newer can generate call to ___tls_get_addr, instead of __tls_get_addr. We can use the weakref assembly directive to redirect __tls_get_addr to ___tls_get_addr if linker supports ___tls_get_addr and GCC doesn't. * sysdeps/unix/sysv/linux/x86_64/64/ld.abilist: Add GLIBC_2.26 and ___tls_get_addr. * sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist: Likewise. * sysdeps/x86_64/Versions: Export ___tls_get_addr in GLIBC_2.26. --- sysdeps/unix/sysv/linux/x86_64/64/ld.abilist | 2 ++ sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist | 2 ++ sysdeps/x86_64/Versions | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist b/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist index 07cab4b..884e52c 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist @@ -6,6 +6,8 @@ GLIBC_2.2.5 calloc F GLIBC_2.2.5 free F GLIBC_2.2.5 malloc F GLIBC_2.2.5 realloc F +GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 ___tls_get_addr F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __tls_get_addr F GLIBC_2.4 GLIBC_2.4 A diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist index 236357b..d42a7a4 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist @@ -7,3 +7,5 @@ GLIBC_2.16 calloc F GLIBC_2.16 free F GLIBC_2.16 malloc F GLIBC_2.16 realloc F +GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 ___tls_get_addr F diff --git a/sysdeps/x86_64/Versions b/sysdeps/x86_64/Versions index a437f85..b8c25c9 100644 --- a/sysdeps/x86_64/Versions +++ b/sysdeps/x86_64/Versions @@ -10,3 +10,9 @@ libm { exp2l; } } +ld { + GLIBC_2.26 { + # The alternative x86-64 runtime interface to TLS with aligned stack. + ___tls_get_addr; + } +} -- 2.9.4