Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nathan Sidwell <nathan@codesourcery.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org,  schwab@suse.de
Subject: Re: [m68k]  return values
Date: Mon, 19 Jun 2006 15:28:00 -0000	[thread overview]
Message-ID: <4496C2AF.2000906@codesourcery.com> (raw)
In-Reply-To: <200606191510.k5JFAfG0028604@elgar.sibelius.xs4all.nl>

Mark Kettenis wrote:

> Well, I fear you've managed to confuse yourself.  The current m68k
> default target uses m68k_extract_return_value(), which reads all
> return values from %d0.

you're right.  ok, the whole problem I'm trying to solve is to get the function 
return working for m68k-elf.  That appears to be a mixture of original and svr4 
features.  Namely:

a) returns always go in %d0 (original)
b) small structures can be passed in registers (svr4)
c) structure return values use the struct_return convention (svr4?)

What approach do you think would be best in tackling this?  The way I'd gone at 
it was to treat the m68k-elf as a variant of svr4 (i.e. #a was the exceptional 
behaviour).  It would be possible to organize it as original ABI, but with #b & 
#c as the exceptions.

Do you think the default should be compatible with m68k-elf, or should the user 
explicitly set the abi in that case?

As you may be aware, #b is implemented by GCC in a horrible way that is 
dependent on internal implementation details -- it's not just that the structure 
is 'small' or even 2^n bytes.  I have a patch that emulate's GCC's behaviour, 
and I was going to post that after this patch was resolved.

It certainly is an adventure trying to figure out what's meant to happen :)

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk


  reply	other threads:[~2006-06-19 15:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-09 13:05 Nathan Sidwell
2006-06-18  1:23 ` Mark Kettenis
2006-06-18  5:51 ` Mark Kettenis
2006-06-19 14:39   ` Nathan Sidwell
2006-06-19 15:12     ` Mark Kettenis
2006-06-19 15:28       ` Nathan Sidwell [this message]
2006-06-19 18:32         ` Mark Kettenis
2006-06-22 11:02           ` Nathan Sidwell

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=4496C2AF.2000906@codesourcery.com \
    --to=nathan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    --cc=schwab@suse.de \
    /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