This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [COMMITTED PATCH] BZ#18383: Add test case for large alignment in TLS blocks.
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Thu, 7 May 2015 13:30:46 -0700
- Subject: Re: [COMMITTED PATCH] BZ#18383: Add test case for large alignment in TLS blocks.
- Authentication-results: sourceware.org; auth=none
- References: <20150506203535 dot 48EAF2C3B9D at topped-with-meat dot com> <CAMe9rOqryFresZrjXDwTnNBVseWh6YfgMAN5+niO4oJhA2-RoA at mail dot gmail dot com> <20150507201552 dot BD89F2C3BA8 at topped-with-meat dot com>
On Thu, May 7, 2015 at 1:15 PM, Roland McGrath <roland@hack.frob.com> wrote:
> Note that your change only affects static linking, while the bug on ARM
> affects dynamic linking as well.
>
> On arm-linux-gnueabihf (test runs under qemu), your change did not fix
> tst-tlsalign-static and it caused these regressions:
>
Someone needs to investigate TLS_DTV_AT_TP targets. Here is a patch
for TLS_TCB_AT_TP targets. OK for master?
--
H.J.
----
We need to align TCB offset to the maximum alignment for TLS_TCB_AT_TP
targets.
* csu/libc-tls.c (__libc_setup_tls): Align TCB offset to the
maximum alignment for TLS_TCB_AT_TP targets.
From dbb8cf8d1d0acdaa9384c995b18f50083ba8f4c9 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 7 May 2015 13:26:34 -0700
Subject: [PATCH] Fix a typo in __libc_setup_tls
We need to align TCB offset to the maximum alignment for TLS_TCB_AT_TP
targets.
* csu/libc-tls.c (__libc_setup_tls): Align TCB offset to the
maximum alignment for TLS_TCB_AT_TP targets.
---
csu/libc-tls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/csu/libc-tls.c b/csu/libc-tls.c
index 64d1779..eead735 100644
--- a/csu/libc-tls.c
+++ b/csu/libc-tls.c
@@ -138,7 +138,7 @@ __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);
--
1.9.3