The current state of the world in GCC says: a handful of setups default to
unique ABIs, but the global default is O32. The default is also to pass no
ABI flags to the assembler.
elf64.h, iris6.h, isa3264.h, and r3900.h override this. Irix defaults to
N32 and passing -n32 which presumably tags binaries; plus the irix
configuration in GDB can handle this. elf64.h does not do pass any flags
but defaults to O64. isa3264.h defaults to MEABI and appears not to tag
binaries. r3900.h defaults to EABI and untagged binaries.
That's mipsisa32-*-elf*, mips64*-*-elf*, mipstx39*-*-elf*,
mips-sgi-irix5cross64, and mips-sgi-irix6*.
So what's a debugger to do? Right now, we try to infer things from our
header files, but only little details of the ABI. In particular, we never
infer O32 correctly. Better would be to match GCC; that's quite
straightforward.
I skipped mipsisa32-*-elf*, because GDB doesn't support MEABI. So this
patch fixes the defaults for mips64*-*-elf* and mipstx39*-*-elf*, and a
little tweaking for IRIX. It then adds a global O32 default. In the
process I found another way that GCC tags binaries with their ABI: a
".mdebug.abi32", etc. section. I handle that too. All appears to work like
a charm. We even get warnings for MEABI etc. binaries.
Andrew, this look OK?
Hmm, this contains several changes: