Re: Making module versions (Was: OFFTOPIC: binary modules, bad idea!)

Stephen Williams (steve@icarus.icarus.com)
Wed, 31 Dec 1997 10:46:53 -0800


teunis@mauve.computersupportcentre.com said:
> No it would not help to coerce 'ld' into this role. The kernel may be
> loaded at a different address every time - and that's where the binary
> has to be relinked to handle.

Well, I don't know how useful it is in the context, but it is not at all
hard to do. Modifications to ld are not required.

I managed to used ld to do run-time linking for an embedded target of mine.
Mainly, I provided a means of getting the symbol values out of the target
board and into an ascii file. This is written into records of the form:

symbol = value

and passed to ld as a linker script. The only remaining piece of information
required is the address of the chunks allocated from the kernel. This can
also be placed in the generated linker script.

The resulting image is fully linked for use by the kernel (in my case a very
simple embedded application) and can be downloaded as a byte stream.

(Incidentally, by keeping this linked-and-ready-to-transmit object around,
I was able to do symbolic debugging of a run-time loaded module on an
embedded target. Way kool?)

Again, this may or may not be useful for the matters of insmod.

-- 
Steve Williams
steve@icarus.com
steve@picturel.com

"The woods are lovely, dark and deep. But I have promises to keep, And lines to code before I sleep, And lines to code before I sleep."