[COMMITTED] BZ#18383: Add test case for large alignment in TLS blocks.
Commit Message
On Wed, May 6, 2015 at 1:35 PM, Roland McGrath <roland@hack.frob.com> 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.
Comments
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:
+FAIL: elf/ifuncmain1picstatic
+FAIL: elf/ifuncmain1static
+FAIL: elf/ifuncmain2picstatic
+FAIL: elf/ifuncmain2static
+FAIL: elf/ifuncmain4picstatic
+FAIL: elf/ifuncmain4static
+FAIL: elf/ifuncmain5picstatic
+FAIL: elf/ifuncmain5static
+FAIL: elf/ifuncmain7picstatic
+FAIL: elf/ifuncmain7static
+FAIL: elf/tst-array1-static
+FAIL: elf/tst-array1-static-cmp
+FAIL: elf/tst-array5-static
+FAIL: elf/tst-array5-static-cmp
+FAIL: elf/tst-dl-iter-static
+FAIL: elf/tst-leaks1-static
+FAIL: elf/tst-tls1-static
+FAIL: elf/tst-tls2-static
+FAIL: elf/tst-tls9-static
@@ -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;