From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 381 invoked by alias); 20 Nov 2002 16:21:20 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 32715 invoked from network); 20 Nov 2002 16:20:04 -0000 Received: from unknown (HELO fw-cam.cambridge.arm.com) (193.131.176.3) by sources.redhat.com with SMTP; 20 Nov 2002 16:20:04 -0000 Received: by fw-cam.cambridge.arm.com; id QAA24427; Wed, 20 Nov 2002 16:19:29 GMT Received: from unknown(172.16.1.2) by fw-cam.cambridge.arm.com via smap (V5.5) id xma022945; Wed, 20 Nov 02 16:18:29 GMT Received: from pc960.cambridge.arm.com (pc960.cambridge.arm.com [10.1.205.4]) by cam-admin0.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id QAA20074; Wed, 20 Nov 2002 16:18:29 GMT Received: from pc960.cambridge.arm.com (rearnsha@localhost) by pc960.cambridge.arm.com (8.11.6/8.9.3) with ESMTP id gAKGITW18622; Wed, 20 Nov 2002 16:18:29 GMT Message-Id: <200211201618.gAKGITW18622@pc960.cambridge.arm.com> X-Authentication-Warning: pc960.cambridge.arm.com: rearnsha owned process doing -bs To: "Kris Warkentin" cc: Richard.Earnshaw@arm.com, gdb@sources.redhat.com Reply-To: Richard.Earnshaw@arm.com Organization: ARM Ltd. X-Telephone: +44 1223 400569 (direct+voicemail), +44 1223 400400 (switchbd) X-Fax: +44 1223 400410 X-Address: ARM Ltd., 110 Fulbourn Road, Cherry Hinton, Cambridge CB1 9NJ. Subject: Re: ARM stack alignment on hand called functions In-reply-to: Your message of "Wed, 20 Nov 2002 11:09:55 EST." <190001c290af$4447fc00$0202040a@catdog> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 20 Nov 2002 08:21:00 -0000 From: Richard Earnshaw X-SW-Source: 2002-11/txt/msg00259.txt.bz2 > ----- Original Message ----- > From: "Richard Earnshaw" > > No, I don't think this is correct, since it will mean that the structure > > starts at an unaligned address. Instead the space allocated for the > > structure on the stack should be rounded up to a word and then the > > structure copied into that space with an aligned starting point. > > But in this case, the issue isn't with passing arguments but rather with > returning them. Earlier in hand_function_call() (in valops.c), there is > some code where if a structure is being returned, we enlarge the stack by > the size of the structure. This is what wasn't aligned. For example, if > you called 'fun2()', which returns a 2 byte structure, the type length was > '2' which is how much the stack pointer is out. This way, when we write the > stack at the start of the called function, our sp is misaligned. The frame > pointer is fine so the function gets the arguments alright, it's just > writing stack variables and return values to the stack that is buggered. > I'm looking at this and thinking, it just gives a little padding on the > stack to maintain alignment. > Then I'm not sure I understand exactly what your problem is. If you show me the actual patch, rather than just trying to describe it, then perhaps that will be more clear. R.