Commit Graph

13 Commits

Author SHA1 Message Date
Stefan Liebler 8646009efd Fix alignment of TLS variables for tls variant TLS_TCB_AT_TP [BZ #23403]
The alignment of TLS variables is wrong if accessed from within a thread
for architectures with tls variant TLS_TCB_AT_TP.
For the main thread the static tls data is properly aligned.
For other threads the alignment depends on the alignment of the thread
pointer as the static tls data is located relative to this pointer.

This patch adds this alignment for TLS_TCB_AT_TP variants in the same way
as it is already done for TLS_DTV_AT_TP. The thread pointer is also already
properly aligned if the user provides its own stack for the new thread.

This patch extends the testcase nptl/tst-tls1.c in order to check the
alignment of the tls variables and it adds a pthread_create invocation
with a user provided stack.
The test itself is migrated from test-skeleton.c to test-driver.c
and the missing support functions xpthread_attr_setstack and xposix_memalign
are added.

ChangeLog:

	[BZ #23403]
	* nptl/allocatestack.c (allocate_stack): Align pointer pd for
	TLS_TCB_AT_TP tls variant.
	* nptl/tst-tls1.c: Migrate to support/test-driver.c.
	Add alignment checks.
	* support/Makefile (libsupport-routines): Add xposix_memalign and
	xpthread_setstack.
	* support/support.h: Add xposix_memalign.
	* support/xthread.h: Add xpthread_attr_setstack.
	* support/xposix_memalign.c: New File.
	* support/xpthread_attr_setstack.c: Likewise.

(cherry picked from commit bc79db3fd487daea36e7c130f943cfb9826a41b4)
2019-11-05 14:36:16 -05:00
Joseph Myers 04277e02d7 Update copyright dates with scripts/update-copyrights.
* All files with FSF copyright notices: Update copyright dates
	using scripts/update-copyrights.
	* locale/programs/charmap-kw.h: Regenerated.
	* locale/programs/locfile-kw.h: Likewise.
2019-01-01 00:11:28 +00:00
Joseph Myers 688903eb3e Update copyright dates with scripts/update-copyrights.
* All files with FSF copyright notices: Update copyright dates
	using scripts/update-copyrights.
	* locale/programs/charmap-kw.h: Regenerated.
	* locale/programs/locfile-kw.h: Likewise.
2018-01-01 00:32:25 +00:00
Joseph Myers bfff8b1bec Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Joseph Myers f7a9f785e5 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Joseph Myers b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Paul Eggert 59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Ulrich Drepper 3ce1f29594 Cleanup of configuration options
Make several tool features mandatory and simplify the code.
2011-09-10 14:34:15 -04:00
Ulrich Drepper 4d1a02efc1 Update.
2004-03-07  Ulrich Drepper  <drepper@redhat.com>

	* tst-once4.c: Remove unnecessary macro definition.

	* tst-mutex7.c (do_test): Limit thread stack size.
	* tst-once2.c (do_test): Likewise.
	* tst-tls3.c (do_test): Likewise.
	* tst-tls1.c (do_test): Likewise.
	* tst-signal3.c (do_test): Likewise.
	* tst-kill6.c (do_test): Likewise.
	* tst-key4.c (do_test): Likewise.
	* tst-join4.c (do_test): Likewise.
	* tst-fork1.c (do_test): Likewise.
	* tst-context1.c (do_test): Likewise.
	* tst-cond2.c (do_test): Likewise.
	* tst-cond10.c (do_test): Likewise.
	* tst-clock2.c (do_test): Likewise.
	* tst-cancel10.c (do_test): Likewise.
	* tst-basic2.c (do_test): Likewise.
	* tst-barrier4.c (do_test): Likewise.
2004-03-07 10:40:53 +00:00
Roland McGrath 3045a1fe89 * Makeconfig (+includes): Don't use $(last-includes). 2003-03-23 11:17:28 +00:00
Ulrich Drepper 5e47b76b50 Update.
* Makefile (tests): Add tst-tls1 and tst-tls2.
	* tst-tls1.c: New file.
	* tst-tls2.c: New file.
2003-02-24 03:50:46 +00:00