From: Roland McGrath Date: Wed, 16 Feb 2005 08:45:56 +0000 (+0000) Subject: 2004-12-21 Jakub Jelinek X-Git-Tag: cvs/fedora-glibc-2_3-20050216T1256~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfba42f233543a068b64c45cffd1ae524acd821c;p=thirdparty%2Fglibc.git 2004-12-21 Jakub Jelinek [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. --- diff --git a/nptl/Makefile b/nptl/Makefile index 8149ef5ed40..3cef684226c 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 693fb0569fb..2f0d88f3037 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 18b038f93ea..945a4c71d65 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))); \