aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2005-02-16 08:45:56 +0000
committerRoland McGrath <roland@gnu.org>2005-02-16 08:45:56 +0000
commitdfba42f233543a068b64c45cffd1ae524acd821c (patch)
tree8cc1caa004558b86c6b434cdb3f84508428984ff
parent2004-12-21 Jakub Jelinek <jakub@redhat.com> (diff)
downloadglibc-dfba42f233543a068b64c45cffd1ae524acd821c.tar.xz
glibc-dfba42f233543a068b64c45cffd1ae524acd821c.zip
2004-12-21 Jakub Jelinek <jakub@redhat.com>
[BZ #723] * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of %esp. * Makefile (tests): Add tst-align2. * tst-align2.c: New test. * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add -mpreferred-stack-boundary=4.
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/sysdeps/i386/Makefile2
-rw-r--r--nptl/sysdeps/i386/tls.h7
3 files changed, 8 insertions, 3 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index 8149ef5ed4..3cef684226 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -205,7 +205,7 @@ tests = tst-attr1 tst-attr2 tst-attr3 \
tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem5 tst-sem6 tst-sem7 \
tst-sem8 tst-sem9 \
tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 \
- tst-align \
+ tst-align tst-align2 \
tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \
tst-kill1 tst-kill2 tst-kill3 tst-kill4 tst-kill5 tst-kill6 \
tst-raise1 \
diff --git a/nptl/sysdeps/i386/Makefile b/nptl/sysdeps/i386/Makefile
index 693fb0569f..2f0d88f303 100644
--- a/nptl/sysdeps/i386/Makefile
+++ b/nptl/sysdeps/i386/Makefile
@@ -22,4 +22,6 @@ endif
ifeq ($(subdir),nptl)
CFLAGS-pthread_create.c += -mpreferred-stack-boundary=4
+CFLAGS-tst-align.c += -mpreferred-stack-boundary=4
+CFLAGS-tst-align2.c += -mpreferred-stack-boundary=4
endif
diff --git a/nptl/sysdeps/i386/tls.h b/nptl/sysdeps/i386/tls.h
index 18b038f93e..945a4c71d6 100644
--- a/nptl/sysdeps/i386/tls.h
+++ b/nptl/sysdeps/i386/tls.h
@@ -397,9 +397,12 @@ union user_desc_init
#define CALL_THREAD_FCT(descr) \
({ void *__res; \
int __ignore1, __ignore2; \
- asm volatile ("pushl %%gs:%P4\n\t" \
+ asm volatile ("pushl %%eax\n\t" \
+ "pushl %%eax\n\t" \
+ "pushl %%eax\n\t" \
+ "pushl %%gs:%P4\n\t" \
"call *%%gs:%P3\n\t" \
- "addl $4, %%esp" \
+ "addl $16, %%esp" \
: "=a" (__res), "=c" (__ignore1), "=d" (__ignore2) \
: "i" (offsetof (struct pthread, start_routine)), \
"i" (offsetof (struct pthread, arg))); \