From patchwork Thu May 7 19:59:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 6622 Received: (qmail 13071 invoked by alias); 7 May 2015 19:59:26 -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 13052 invoked by uid 89); 7 May 2015 19:59:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f180.google.com MIME-Version: 1.0 X-Received: by 10.60.55.36 with SMTP id o4mr299637oep.0.1431028762399; Thu, 07 May 2015 12:59:22 -0700 (PDT) In-Reply-To: <20150506203535.48EAF2C3B9D@topped-with-meat.com> References: <20150506203535.48EAF2C3B9D@topped-with-meat.com> Date: Thu, 7 May 2015 12:59:22 -0700 Message-ID: Subject: Re: [COMMITTED PATCH] BZ#18383: Add test case for large alignment in TLS blocks. From: "H.J. Lu" To: Roland McGrath Cc: "GNU C. Library" On Wed, May 6, 2015 at 1:35 PM, Roland McGrath wrote: > I just filed this bug and committed this test case for it. I've marked > both flavors of the test as XFAIL. On ARM, both flavors fail (wrong > alignment). On x86-64 the dynamically-linked test works right but the > statically-linked test crashes in startup. I suspect other machines are > affected as well and that the bug is not actually machine-dependent. > > I will probably try to look into this next week, but it would be lovely > if someone else wants to take a crack at it first. > It is a typo. I am testing the following patch on ia32, x86-64 and x32 which define TLS_TCB_AT_TP. Can someone please test it on aarch64, arm and powerpc, which define TLS_DTV_AT_TP? Thanks. diff --git a/csu/libc-tls.c b/csu/libc-tls.c index 64d1779..d797ef4 100644 --- a/csu/libc-tls.c +++ b/csu/libc-tls.c @@ -138,10 +138,10 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign) to request some surplus that permits dynamic loading of modules with IE-model TLS. */ #if TLS_TCB_AT_TP - tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign); + tcb_offset = roundup (memsz + GL(dl_tls_static_size), max_align); tlsblock = __sbrk (tcb_offset + tcbsize + max_align); #elif TLS_DTV_AT_TP - tcb_offset = roundup (tcbsize, align ?: 1); + tcb_offset = roundup (tcbsize, max_align ?: 1); tlsblock = __sbrk (tcb_offset + memsz + max_align + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size)); tlsblock += TLS_PRE_TCB_SIZE;