This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfa] mips argument passing fixes for o32
- To: drow at mvista dot com, David B Anderson <davea at quasar dot engr dot sgi dot com>, Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: [rfa] mips argument passing fixes for o32
- From: David B Anderson <davea at quasar dot engr dot sgi dot com>
- Date: Sun, 15 Jul 2001 20:28:46 -0700 (PDT)
- Cc: gdb-patches at sources dot redhat dot com
- References: <200107130003.RAA57770@quasar.engr.sgi.com>
Andrew Cagney:
|> Andrew Cagney:
|> |(A+3, yes, sorry).
|> |
|> |The SGI compilers are big endian (correct?) so who knows what they would
|> |do in the little endian case.
|>
|>
|> Correct. Years ago it was possible to emit little-endian
|> code, but on MIPS/IRIX that was irrelevant and is no longer
|> supported.
|> davea@sgi.com
|
|
|You wouldn't have access to such a machine by any chance? :-)
|
|I'm getting the feeling I'm wrong with this one - for some strange
|historical reason LE o32 really does left/right shift small parameters
|(I'm still mining the archives).
|
|Assuming that is the case ...
Oh boy. I have to admit I ignored -EL (which 032 (cc -32)
still admits is a real option) back when it was
sort of current. Big endian bigot :-) Sorry.
Today, the -EL sort of still works, o32, and generates 2LSB elf.
But it's not 'supported' so supported is here a weasel-word.
We don't test it.
But anyone with an IRIX cc -32 can look at the generated code.
Unfortunately, the MIPS disassembler (recent)
kind of barfs on little endian objects (I said we don't test -EL)...
davea
|> if (!MIPS_EABI
|> && MIPS_SAVED_REGSIZE < 8
|> - && TARGET_BYTE_ORDER == BIG_ENDIAN
|> + && (TARGET_BYTE_ORDER == BIG_ENDIAN
|> + || TYPE_LENGTH (arg_type) < MIPS_SAVED_REGSIZE)
|> && partial_len < MIPS_SAVED_REGSIZE
|> && (typecode == TYPE_CODE_STRUCT ||
|> typecode == TYPE_CODE_UNION))
|
|I don't know that line being added should be
||| TYPE_LENGTH (arg_type) < MIPS_SAVED_REGSIZE
|
|
|it should at least be guarded by ``ABI == o32''. What does LE n32 do
|for instance?
|If GCC, for o32, always left shifts the structs dregs (PARTIAL_LEN <
|MIPS_SAVED_REGSIZE) then is just the ABI test needed?
|
| Andrew
|
|PS: That function is the official example of how to _not_ multi-arch an ABI.
And now I confess I don't quite understand the question.
Ah. mips_push_arguments().
The question is whether to shift the contents?
It's likely I don't really grasp the subtleties of the question
here at the moment.
struct mys {
int a;
char b;
};
as a struct argument, with cc -32 -EL, does not seem to do more than
load b into the second arg reg (r5) and a into r4 if one does
struct mys m
myfunc(m);
But I don't feel confident that answers anything, really.
I (and anyone with IRIX cc -32) can do -EL -32.
(With -n32 and -64, -EL is ignored by IRIX cc. )
If you had a sample you wondered about I could certainly
compile it -EL, send assembler to anyone.
If it would help. As I said,
any IRIX cc -32 still sort of, unoficially, does try to honor -EL.
Hmm. Well hope this helps a little....
davea@sgi.com