From patchwork Thu Jul 28 20:34:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 73006 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1039202qga; Thu, 28 Jul 2016 13:35:25 -0700 (PDT) X-Received: by 10.66.193.7 with SMTP id hk7mr46603160pac.78.1469738125716; Thu, 28 Jul 2016 13:35:25 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u3si14029108pfj.160.2016.07.28.13.35.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jul 2016 13:35:25 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-72051-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-72051-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-72051-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=WxOkUYCaMXLNgFvHJYKxmaM1Tm8trxf1PQ6pSvrp36oEeCwJ+9QgC Huv9bSVBVzlnCXr2s824+8D/SMNh9ewG+/Nq3pval5EmNM/4I8VoPu4kBZVUPBNT 5Uv5+IyWcZshW7ip1BKbx5XaMcmMBZsIvx+pjbTMP+7k9bfskvfZpM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=2JXlP1n1LZL/gE73iJdJlNNZXqE=; b=oXCUJqmyjyQHBNXr84LGUkwmRy7O Itr64lqv6iv+qbOjSBGNQ0sTIMSTlke7X01LMuJwLM2vwluOcFaARNOJAEc/GJyo wys1AkIkP92PST0UMPyGOr8rdoGdLuUDmdD5iPkOfckqNVBF1wYLwgYG/CO9ciSK ZkmyOviZ7nSzF5U= Received: (qmail 80075 invoked by alias); 28 Jul 2016 20:35:13 -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 80058 invoked by uid 89); 28 Jul 2016 20:35:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=tcb, 2.7.4, ifeq, H*MI:8293 X-HELO: mail-yw0-f180.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=U2nVjCWRtt434JesGgeoBbV/npSu+axKIAXW3EKCxtA=; b=iZsCsSt6KcNvgYOFJw1di53Qfm9IRkaYfowDu/2Ww2f3vLlZDvB5iUX0HIToGJItco mz0iMWcaw7DKVPLgyRA+M/0FDkjCSDnxCRDQ5AXfXb+nSS46tVcPFrNedAbXRYUUnFOT HuOsj4N0U0xDG6IIBE7sb7qRQVRZ6dpT1vPmLv9MXelemXLhzfj/SNo8Shl/ds71FqbV TlN4H0iU4IK7jWAHlahMQ8WpNaJ4KvZOHRQafnAiZAzR6JPn5mLC5i98CNdRtEV5NV6M 8GeiTkUdDOQUMdztMzarR0YSedPnsi2H444ue7S8f63H+pFdNw8Y0Ihy7txHFU2AAdSp dp6w== X-Gm-Message-State: AEkoout+ftaeQOqs3F3NH+Rl0e37lLOracTZHEGcfRrasMp74lgdFLBbjT71m/gOpycItUZT X-Received: by 10.129.27.14 with SMTP id b14mr21474213ywb.306.1469738099356; Thu, 28 Jul 2016 13:34:59 -0700 (PDT) From: Adhemerval Zanella X-Google-Original-From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Adhemerval Zanella Subject: [PATCH] aarch64: Add split-stack TCB field Date: Thu, 28 Jul 2016 17:34:48 -0300 Message-Id: <1469738088-8293-1-git-send-email-adhemerval.zanella@linaro.com> From: Adhemerval Zanella This patch adds a new TCB field meant to be used by GCC split-stack option. A new symbol, __tcb_private_ss, is also added to version control the private TCB field. For AArch64 the TCB access is the most efficient one, since for split-stack a per-thread variable is required and TLS initial-exec mode requires a GOT access. Checked on aarch64 and this is meant for 2.25. * sysdeps/aarch64/Makefile [$(subdir) == elf] (sysdep-dl-routines): Add tcb-version. * sysdeps/aarch64/Version [ld] (GLIBC_2.25): Define __tcb_private ss; * sysdeps/aarch64/nptl/tls.h (tcbhead_t): Add __private_ss field. * sysdeps/unix/sysv/linux/aarch64/ld.abilist: Add GLIBC_2.25 and __tcb_private_ss. * sysdeps/aarch64/tcb-version.c: New file. --- ChangeLog | 11 +++++++++++ sysdeps/aarch64/Makefile | 2 +- sysdeps/aarch64/Versions | 8 ++++++++ sysdeps/aarch64/nptl/tls.h | 2 ++ sysdeps/aarch64/tcb-version.c | 24 ++++++++++++++++++++++++ sysdeps/unix/sysv/linux/aarch64/ld.abilist | 2 ++ 6 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 sysdeps/aarch64/tcb-version.c -- 2.7.4 diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile index 562c137..0155988 100644 --- a/sysdeps/aarch64/Makefile +++ b/sysdeps/aarch64/Makefile @@ -5,7 +5,7 @@ CFLAGS-backtrace.c += -funwind-tables endif ifeq ($(subdir),elf) -sysdep-dl-routines += tlsdesc dl-tlsdesc +sysdep-dl-routines += tlsdesc dl-tlsdesc tcb-version gen-as-const-headers += dl-link.sym endif diff --git a/sysdeps/aarch64/Versions b/sysdeps/aarch64/Versions index e1aa44f..36a3e91 100644 --- a/sysdeps/aarch64/Versions +++ b/sysdeps/aarch64/Versions @@ -3,3 +3,11 @@ libc { _mcount; } } + +ld { + GLIBC_2.25 { + # Symbol used to version control the private GLIBC TCB split-stack + # field. + __tcb_private_ss; + } +} diff --git a/sysdeps/aarch64/nptl/tls.h b/sysdeps/aarch64/nptl/tls.h index c5f20ef..fded63a 100644 --- a/sysdeps/aarch64/nptl/tls.h +++ b/sysdeps/aarch64/nptl/tls.h @@ -47,6 +47,8 @@ typedef struct { dtv_t *dtv; void *private; + /* GCC split stack support. */ + void *__private_ss; } tcbhead_t; /* This is the size of the initial TCB. */ diff --git a/sysdeps/aarch64/tcb-version.c b/sysdeps/aarch64/tcb-version.c new file mode 100644 index 0000000..5c82cd7 --- /dev/null +++ b/sysdeps/aarch64/tcb-version.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* Symbol used to version control the private GLIBC TCB split-stack + field. */ +void +__tcb_private_ss (void) +{ +} diff --git a/sysdeps/unix/sysv/linux/aarch64/ld.abilist b/sysdeps/unix/sysv/linux/aarch64/ld.abilist index ab08a98..00aa781 100644 --- a/sysdeps/unix/sysv/linux/aarch64/ld.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/ld.abilist @@ -9,3 +9,5 @@ GLIBC_2.17 calloc F GLIBC_2.17 free F GLIBC_2.17 malloc F GLIBC_2.17 realloc F +GLIBC_2.25 GLIBC_2.24 A +GLIBC_2.25 __tcb_private_ss F