Subject: Re: Do LKMs work *at*all* on powerpc platforms?
To: Bill Studenmund <wrstuden@zembu.com>
From: Todd Vierling <tv@wasabisystems.com>
List: port-macppc
Date: 08/14/2000 21:41:25
[Lots of recipients moved to Bcc: or removed completely]

On Mon, 14 Aug 2000, Bill Studenmund wrote:

: > Hiding the -mlong-call (which doesn't work in the cc we're currently
: > using right now, remember) withing -D_LKM somehow will just lead to
: > people forgetting it's even necessary to do __attribute__
: > ((shortcall)) (which they can't anyhow with the cc we've got), and
: > make their code inexplicably slow.
: 
: I don't think that not using short-call will make the calls inexplicably
: slow, it will just make the calls slower than they might be. :-)

The correct way to do this is to use -mlong-call when compiling...

...period.

SPARC, for instance, can call within a 13-bit offset, or use a full 32-bit
reloc; however, we use the 32-bit reloc by default because It Works
Everywhere.  When the referenced function is in the same source file, it
will use the short reloc automatically.  The same is likely true of gcc for
powerpc.

Adding attributes to functions for the purposes of a longer-reloc calling
mechanism is just too much of a maintenance nightmare.  Unless the function
attributes are necessary to indicate a very strange calling convention
(which this isn't), they don't belong in the NetBSD source tree.  If you
want to use LKMs, "deal with it."  After all, the -mlong-call calling
mechanism is not even as slow as PIC (shared library) code.

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  http://www.wasabisystems.com/
-- Speed, stability, security, and support.  Wasabi NetBSD:  Run with it.