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."