Subject: Re: Do LKMs work *at*all* on powerpc platforms?
To: Greg Kritsch <greg@evertz.com>
From: gabriel rosenkoetter <gr@eclipsed.net>
List: port-macppc
Date: 08/02/2000 19:42:38
On Wed, Aug 02, 2000 at 07:34:26PM -0400, gabriel rosenkoetter wrote:
> In the end, however, it's not possible to just do this in my own
> source and have a working LKM on powerpc, because...
> 
> achemar:misc/module# make load                                              [4]
> modload -o miscmod -emiscmod combined.o
> combined.o: In function `miscmod_handle':
> combined.o(.text+0x114): relocation truncated to fit: R_PPC_REL24 memcpy
> combined.o(.text+0x140): relocation truncated to fit: R_PPC_REL24 memcpy
> combined.o(.text+0x1f8): relocation truncated to fit: R_PPC_REL24 memcpy
> modload: can't link `combined.o' creating `miscmod' bound to 0xe921b000
> *** Error code 1
> 
> Stop.
> 
> miscmod_handle isn't a function that exists in the example
> misc module, it's part of the LKM functionality. I *think* it's a
> symbol read out of the kernel, but I haven't even thought about it
> hard.

Okay, that isn't *quite* true. miscmod(), the module's external entry
point, looks like this:

miscmod( lkmtp, cmd, ver)
struct lkm_table    *lkmtp;
int         cmd;
int         ver;
{        
    DISPATCH(lkmtp,cmd,ver,miscmod_handle,miscmod_handle,lkm_nofunc)
}        

Though we've fixed memcpy() for miscmod_handle() here (I was wrong, it
is, in fact, in miscmod.c), it would seem our fix doesn't last after
DISPATCH() (in sys/lkm.h) gets ahold of the function and does a load()
with it.

Or perhaps I'm still being thick-headed.

       ~ g r @ eclipsed.net