Symbol in GNU ld script

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
yukito

Symbol in GNU ld script

Post by yukito »

Hi again!

Reading Tim Robinsons' first memory management tutorial, I came across
We know the address of the start and end of our kernel (you can set a symbol to the end of the kernel image in
a GNU ld script, for example). From this we can work out how big the kernel is so that we can avoid
allocating memory from the kernel?s space ? to allocate memory from the middle of the kernel would be fatal.
So after a quick search on google, I found that I should put

Code: Select all

_endofkernel = ABSOLUTE(.) ;
somewhere, but where? Or can I just write

Code: Select all

_endofkernel = . ;
at the end of the script, just before the final '}' ?
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Symbol in GNU ld script

Post by Solar »

I'm not an ld scripting expert, but seeing how I (successfully) set start_ctors and end_ctors in BareBonesC++, I'd say setting _endkernel = . at the end of your linker script should be sufficient.
Every good solution is obvious once you've found it.
yukito

Re:Symbol in GNU ld script

Post by yukito »

Thank you!
Post Reply