Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965183AbVINOWL (ORCPT ); Wed, 14 Sep 2005 10:22:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965189AbVINOWL (ORCPT ); Wed, 14 Sep 2005 10:22:11 -0400 Received: from nevyn.them.org ([66.93.172.17]:5068 "EHLO nevyn.them.org") by vger.kernel.org with ESMTP id S965183AbVINOWJ (ORCPT ); Wed, 14 Sep 2005 10:22:09 -0400 Date: Wed, 14 Sep 2005 10:22:04 -0400 From: Daniel Jacobowitz To: Linus Torvalds Cc: "Markus F.X.J. Oberhumer" , linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH] i386: fix stack alignment for signal handlers Message-ID: <20050914142204.GA19731@nevyn.them.org> Mail-Followup-To: Linus Torvalds , "Markus F.X.J. Oberhumer" , linux-kernel@vger.kernel.org, Andi Kleen References: <43273CB3.7090200@oberhumer.com> <4327611D.7@oberhumer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1171 Lines: 28 On Tue, Sep 13, 2005 at 04:52:30PM -0700, Linus Torvalds wrote: > Your test program does seems to imply that gcc wants the alignment before > the return address (ie it prints out an address that is 4 bytes offset), > but on the other hand I'm not even sure how careful gcc is about this > alignment thing at all. Very, on architectures where the ABI requires alignment. E.G. for vector register loads that require 16-byte alignment to avoid a trap. The comment for the relevant bits of the GCC configuration says it won't assume this for x86, but I believe that comment is out of date. I think it'll assume 16-byte alignment on entrance to non-main() functions. > In the "main()" function, gcc will actually generate a "andl $-16,%esp" to > force the alignment, but ot in the handler function. Just a gcc special > case? Random luck? Special case. This is only done for main(). -- Daniel Jacobowitz CodeSourcery, LLC - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/