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: Roland McGrath <roland at hack dot frob dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Tue, 9 Jun 2015 16:34:17 -0700 (PDT)
- 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> <CAMe9rOr4kRxVYXnrxhAm7ctkxMEJtbMx3Qwhza6LUyYj03yjZw at mail dot gmail dot com> <20150507211000 dot B2B932C3B91 at topped-with-meat dot com> <CAMe9rOqBNixXBbOsuRHYTcLM_1+tp5ohJdSOmRFHK0gA-vDL3A at mail dot gmail dot com>
> [BZ #18383]
> * csu/libc-tls.c (__libc_setup_tls): Align TCB offset to the
> maximum alignment for TLS_TCB_AT_TP targets.
* csu/libc-tls.c (__libc_setup_tls) [TLS_TCB_AT_TP]:
Align TCB_OFFSET to MAX_ALIGN, not just TCBALIGN. Add comment.
> @@ -138,7 +138,9 @@ __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);
> + /* Align the TCB offset to the maximum alignment, similar to what
> + _dl_allocate_tls_storage in elf/dl-tls.c does. */
> + tcb_offset = roundup (memsz + GL(dl_tls_static_size), max_align);
This would be yet more clear if it said:
/* Align the TCB offset to the maximum alignment, as
_dl_allocate_tls_storage (in elf/dl-tls.c) does using __libc_memalign
and dl_tls_static_align. */
The patch should also remove the XFAIL for tst-align-extern-static
and update the comment on the XFAILs for tst-tlsalign{,-static}
not to say that x86 is broken.
OK with those details.
Thanks,
Roland