Re: Why Plan 9 C compilers don't have asm("")

Richard Henderson (rth@twiddle.net)
Sat, 21 Jul 2001 23:49:52 -0700


On Sat, Jul 21, 2001 at 08:43:43PM -0700, Linus Torvalds wrote:
> So:
> - you _always_ generate the fast case. A call is always considered to be
> a short one, simple "bsr", no GP change, no nothing.
> - you generate a trampoline as well, and teach the linker to go through
> the trampoline if it has to do a far call (one trampoline per target,
> not per caller). Think of it as a "overflow" case for a .rel20.

This is all well and good if one is designing an ABI from scratch.
You can't retrofit it onto the current ABI, however. Not without
pain anyway.

The call-clobbered GP means that your trampoline has to play games
in order to get the GP restored when coming back from an intra
module call. Which means a new stack frame. Which is a tad more
than you bargined for, really. I can't see that kind of heavyweight
solution being any better than the nops.

r~
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/