From: janani@linux.ibm.com
To: gdb-patches@sourceware.org
Cc: janani@us.ibm.com, drow@false.org
Subject: Re: [patch] Pushing Inferior Function Arguments onto Stack on PowerPC64 machines
Date: Wed, 04 Oct 2006 19:54:00 -0000 [thread overview]
Message-ID: <20061004155434.jjq724t40kwosws8@imap.linux.ibm.com> (raw)
Sorry about the email address goofup. Am trying to use a new account
so that HTML tags don't get in the way. Have to figure out a way to
enable me to receive email at this address. My other external email
address is janani@us.ibm.com
From reading the PPC64 Platform ABI at
http://www.freestandards.org/spec/ELF/ppc64/PPC-elf64abi-1.9.html
( see section 3.1.7) it appears that on Big Endian machines,
values are left aligned. But looks like GCC has different rules and
right aligns the values which are put on the
registers. This matches Andrew Cagney comment in the code, that says
that ABI specifies that the values
should be left aligned. But like I said in my earlier note, GCC
appears to want the values to be
right aligned. Would appreciate another set of eyes looking at it as
I don't have too much experience
in this area.
Daniel Jacobowitz <drow@false.org> wrote on 10/04/2006 02:10:56 PM:
> On Wed, Oct 04, 2006 at 03:00:34PM -0400, janani@linux.ibm.com wrote:
> > I am new to this, so my interpretation might not be completely >
> accurate, but the way I read the note below ( a snippet from the GNU
> > GCC Manual about passing function arguments in registers) is that
> > since PPC64 is big endian, even though the default is to pad
> downward > (i.e. right align), if the size if greater than the size
> of an int, > you need to pad upward (left align).
>
> You're trying to answer the wrong question :-)
>
> It's not "what does GCC do", but "what does the platform ABI say we
> should do". Is GCC conforming to the ABI? Is the ABI wrong, or out of
> date, or was Andrew's reading of it wrong, or...
>
> There could be a real problem here, so it's important that we
> understand what is _supposed_ to happen before we make a change.
> If GCC is violating the ABI, then either GCC or the ABI may need to be
> updated. If GDB is misinterpreting the ABI, then just GDB needs to be
> changed.
>
> --
> Daniel Jacobowitz
> CodeSourcery
> ! /* WARNING: cagney/2003-09-21: As best I can
> ! tell, the ABI specifies that the value should
> ! be left aligned. Unfortunately, GCC doesn't
> ! do this - it instead right aligns even sized
> ! values and puts odd sized values on the
> ! stack. Work around that by putting both a
> ! left and right aligned value into the
> ! register (hopefully no one notices :-^).
> ! Arrrgh! */
> ! /* Left aligned (8 byte values such as pointers
> ! fill the buffer). */
> ! memcpy (regval, val + byte, len);
> ! /* Right aligned (but only if even). */
> ! if (len == 1 || len == 2 || len == 4)
> ! memcpy (regval + tdep->wordsize - len,
Janani Janakiraman
next reply other threads:[~2006-10-04 19:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-04 19:54 janani [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-10-04 21:02 janani
2006-10-04 19:00 janani
2006-10-04 19:11 ` Daniel Jacobowitz
2006-10-04 19:14 ` Daniel Jacobowitz
2006-10-04 20:19 ` Mark Kettenis
2006-10-04 20:27 ` Andreas Schwab
[not found] ` <OFE88464A1.C58B072A-ON872571FD.006ABA69-862571FD.006C7CFB@us.ibm.com>
2006-10-04 20:26 ` Daniel Jacobowitz
[not found] ` <drow@false.org>
2006-10-04 20:43 ` David Edelsohn
2006-10-04 20:52 ` Daniel Jacobowitz
2006-10-03 19:15 Janani Janakiraman
2006-10-03 19:20 ` Daniel Jacobowitz
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=20061004155434.jjq724t40kwosws8@imap.linux.ibm.com \
--to=janani@linux.ibm.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=janani@us.ibm.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