Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com>
To: "Kris Warkentin" <kewarken@qnx.com>
Cc: Richard.Earnshaw@arm.com, gdb@sources.redhat.com
Subject: Re: ARM stack alignment on hand called functions
Date: Wed, 20 Nov 2002 08:21:00 -0000	[thread overview]
Message-ID: <200211201618.gAKGITW18622@pc960.cambridge.arm.com> (raw)
In-Reply-To: Your message of "Wed, 20 Nov 2002 11:09:55 EST." <190001c290af$4447fc00$0202040a@catdog>

> ----- Original Message -----
> From: "Richard Earnshaw" <rearnsha@arm.com>
> > 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.


  reply	other threads:[~2002-11-20 16:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-20  7:29 Kris Warkentin
2002-11-20  7:58 ` Richard Earnshaw
2002-11-20  8:10   ` Kris Warkentin
2002-11-20  8:21     ` Richard Earnshaw [this message]
2002-11-20  8:26       ` Kris Warkentin
2002-11-20  9:18         ` Andrew Cagney
2002-11-20  9:35           ` Kris Warkentin
2002-11-26 14:01             ` Andrew Cagney
2002-11-27  1:18               ` Richard Earnshaw
2002-11-20 10:37         ` Richard Earnshaw
2002-11-20 10:59           ` Kris Warkentin
2002-11-20 11:40             ` Kris Warkentin
2002-11-21  2:58               ` Richard Earnshaw
     [not found] <200211272021.PAA04606@hub.ott.qnx.com>
2002-11-27 13:13 ` Kris Warkentin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200211201618.gAKGITW18622@pc960.cambridge.arm.com \
    --to=rearnsha@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gdb@sources.redhat.com \
    --cc=kewarken@qnx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox