From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13131 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] fix tls access on arm targets before armv6k Date: Thu, 23 Aug 2018 16:10:29 +0200 Message-ID: <20180823141029.GB4418@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="mXDO3udm/xYWQeMQ" X-Trace: blaine.gmane.org 1535033319 16836 195.159.176.226 (23 Aug 2018 14:08:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 23 Aug 2018 14:08:39 +0000 (UTC) User-Agent: Mutt/1.9.1 (2017-09-22) To: musl@lists.openwall.com Original-X-From: musl-return-13147-gllmg-musl=m.gmane.org@lists.openwall.com Thu Aug 23 16:08:35 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fsqHr-0004Hq-3E for gllmg-musl@m.gmane.org; Thu, 23 Aug 2018 16:08:35 +0200 Original-Received: (qmail 25650 invoked by uid 550); 23 Aug 2018 14:10:41 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 25612 invoked from network); 23 Aug 2018 14:10:41 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline Xref: news.gmane.org gmane.linux.lib.musl.general:13131 Archived-At: --mXDO3udm/xYWQeMQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline fixing the 'large tls alignment on tls above tp targets' issue introduced a regression on arm which i didnt notice because i only tested it with armv7-a code gen. fortunately there was no release since that commit. --mXDO3udm/xYWQeMQ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-fix-tls-access-on-arm-targets-before-armv6k.patch" >From 539dc72e6d75779082c862b2bb4463c2af4b7953 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 23 Aug 2018 10:57:34 +0000 Subject: [PATCH] fix tls access on arm targets before armv6k commit 610c5a8524c3d6cd3ac5a5f1231422e7648a3791 changed the thread pointer setup so tp points at the end of the pthread struct on arm, but failed to update __aeabi_read_tp so it was off by 8. this broke tls access in code that is compiled with -mtp=soft, which is the default when target arch is pre armv6k or thumb1. --- src/thread/arm/__aeabi_read_tp_c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thread/arm/__aeabi_read_tp_c.c b/src/thread/arm/__aeabi_read_tp_c.c index 654bdc57..0c56d613 100644 --- a/src/thread/arm/__aeabi_read_tp_c.c +++ b/src/thread/arm/__aeabi_read_tp_c.c @@ -4,5 +4,5 @@ __attribute__((__visibility__("hidden"))) void *__aeabi_read_tp_c(void) { - return (void *)((uintptr_t)__pthread_self()-8+sizeof(struct pthread)); + return TP_ADJ(__pthread_self()); } -- 2.17.1 --mXDO3udm/xYWQeMQ--