ld scripts

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

ld scripts

Post by Adek336 »

Hello. My kernel works fine, but perhaps it will work better if I make a ld script? Could you tell me what it does?

Cheers,
Adrian
carbonBased

RE:ld scripts

Post by carbonBased »

If your kernel works, you don't need a linker script :)

Linker scripts just tell the linker how, and where you want to link your code.

In other words, you can tell it, at which address to put each section.  What to include in each section.  Define addresses at certain points and make them available to your code, etc, etc.

However, you don't _need_ them, usually ever... they're just nice if you want complete control.  I needed them for my kernel, but I needed to link in a specific way to be multiboot compatible, and I wanted to ignore certain sections (ie, the nasm comment section... worthless!)

Cheers,
Jeff
Post Reply