leaving undefined references by ld

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Adek336

leaving undefined references by ld

Post by Adek336 »

Hi! I made a simple run-time linker, and now every module (loaded by grub) is able to use any other's functions and data. Now the primary kernel would also, but ld doesn't leave any undefined references which I would patch with symbols from other modules.. so is there a way to leave the undefined references there?

Cheers,
Adrian
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:leaving undefined references by ld

Post by df »

latebinding, no, unless you created the kernel as an object itself...

so what grub loads can be your linker, your main kernel etc can all be objects...
-- Stu --
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:leaving undefined references by ld

Post by Candy »

As I imagined it, I want to use an object repository for all objects the modules use, so I don't have to link the modules with the kernel (still severely limits a design) but just make new modules separate from the kernel, and map them using a database (module with this class & this type, use this driver). That would make them all dynamic.

To make the modules all be able to use the kernel, I want a partial linker in my kernel. At least up to the level that it can link additional objects into the system at runtime, so it can use them like native.

I am also planning on devising some sort of PLT-like linking table so I can make the calls to other modules as quick as just calling the kernel.

I also want a module fixer for each system, so you leave the object completely unlinked as a portable driver, then "install" it as a nonportable driver with the links to the OS linked permanently and the others still open, and then the last state as loaded with all links established (which isn't much different from the second, possibly none).

Hope to help your design,

Candy
Adek336

Re:leaving undefined references by ld

Post by Adek336 »

Thank you for your reply.

Candy: I see you have designed your method in every aspect! At this moment I'll be trying to make it as simple as possible but, I will think about all those nifty features. What do you think of a system where all modules are in kernel space and none in user? Something like Linux, I don't like the microkernel design very much.

DF: That seems a good idea.. one more question: it seems my kmalloc() implementation is needed by the linker, does it have any meaning it will be loaded with the linker's module?

Cheers,
Adrian.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:leaving undefined references by ld

Post by Candy »

<pype>
the very interresting content of this post have been promoted to a thread of its own as it start drifting from the topic, and will probably drift even more once i (or someone else) will respond to it ;)
</pype>
Post Reply