http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48835
--- Comment #5 from Thorsten Glaser <tg at mirbsd dot org> 2011-04-30 22:28:03
UTC ---
(In reply to comment #2)
> the caller expects the returned value in %a0.
It’s even worse, __gnat_malloc contains:
jsr malloc
addq.l #4,%sp
move.l %d0,-8(%fp)
Apparently, the Ada functions that are {Im,Ex}port’ed all assume
they get their values in d0 not a0…
I wonder if this is a conceptual problem preventing Ada to work
with the m68k ELF ABI. How does vxworks/m68k (which, apparently,
has a GNAT port) manage it? (Even if we “fix” the Export, the
Import of libc malloc will still fail… would this work if some
types were handled specially (like System.Address)? I wonder how
many third-party programmes would break on m68k when they have C
imports with uncleanly specified types then…)