Subject: Re: Loading DSP code from an LKM
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 09/30/2001 06:48:40
>> [H]ave the linker, perhaps under control of a suitable option,
>> generate stub long jumps as necessary.  The fixup would occur when
>> the LKM .o file is linked against the kernel; when jumps are too
>> long, ld would then generate a small blob of three or four
>> instructions and point the short jump reloc at that blob; the blob
>> would be the long jump.

> Wouldn't this have problems with local branches within functions,
> like those generated for if/then/else and switch?  All the offsets
> are generated at assembly time, not link time.

...which means they won't have relocation records, so the proposed fix
won't even know the exist and hence won't touch them.

If there is a branch that is fully resolved at assembly time that is
too long for a short branch, you will lose, yes.  That means a single
assembly generates at least 128MB of text segment (I think actually
256MB) - not worth worrying about, at least not in this context.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B