From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13899 invoked by alias); 8 Aug 2011 14:16:03 -0000 Received: (qmail 13863 invoked by uid 22791); 8 Aug 2011 14:16:02 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_OV X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Aug 2011 14:15:44 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p78EFh0s016121 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Aug 2011 10:15:44 -0400 Received: from hase.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p78EFfQ5004887 for ; Mon, 8 Aug 2011 10:15:43 -0400 From: Andreas Schwab To: libc-hacker@sourceware.org Subject: [PATCH] Fix stack alignment on x86_64 X-Yow: Are we live or on tape? Date: Mon, 08 Aug 2011 14:16:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2011-08/txt/msg00000.txt.bz2 2011-08-08 Andreas Schwab * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Maintain aligned stack. * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise. --- nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S | 6 ++++-- .../sysv/linux/x86_64/pthread_cond_timedwait.S | 6 +++--- .../unix/sysv/linux/x86_64/pthread_cond_wait.S | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S b/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S index 6806962..a06cd9b 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Free Software Foundation, Inc. +/* Copyright (C) 2009, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2009. @@ -71,7 +71,9 @@ ENTRY(__pthread_enable_asynccancel) 1: ret -3: movq $TCB_PTHREAD_CANCELED, %fs:RESULT +3: subq $8, %rsp + cfi_adjust_cfa_offset(8) + movq $TCB_PTHREAD_CANCELED, %fs:RESULT lock orl $TCB_EXITING_BITMASK, %fs:CANCELHANDLING movq %fs:CLEANUP_JMP_BUF, %rdi diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S index e6535fb..48ea8b9 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2005, 2007, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 2002-2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -63,9 +63,9 @@ __pthread_cond_timedwait: cfi_adjust_cfa_offset(8) cfi_rel_offset(%r15, 0) #ifdef __ASSUME_FUTEX_CLOCK_REALTIME -# define FRAME_SIZE 32 +# define FRAME_SIZE (32+8) #else -# define FRAME_SIZE 48 +# define FRAME_SIZE (48+8) #endif subq $FRAME_SIZE, %rsp cfi_adjust_cfa_offset(FRAME_SIZE) diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S index f5b929e..7535baa 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2007, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2002-2007, 2009, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -45,7 +45,7 @@ __pthread_cond_wait: cfi_lsda(DW_EH_PE_udata4, .LexceptSTART) #endif -#define FRAME_SIZE 32 +#define FRAME_SIZE (32+8) leaq -FRAME_SIZE(%rsp), %rsp cfi_adjust_cfa_offset(FRAME_SIZE) -- 1.7.6 -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different."