Page 1 of 1

Symbol in GNU ld script

Posted: Thu Sep 29, 2005 1:45 am
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 '}' ?

Re:Symbol in GNU ld script

Posted: Thu Sep 29, 2005 2:03 am
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.

Re:Symbol in GNU ld script

Posted: Thu Sep 29, 2005 2:09 am
by yukito
Thank you!