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.
James Molloy's tutorial uses the link.ld file as copy-pasted below.
Question: what does the __end label represent?
More specifically: is it a pointer to the last byte of the binary, or in C++ STL style, to the byte after the last byte of the binary (thereby pointing "outside")?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Espanish wrote:James Molloy's tutorial uses the link.ld file as copy-pasted below.
Question: what does the __end label represent?
More specifically: is it a pointer to the last byte of the binary, or in C++ STL style, to the byte after the last byte of the binary (thereby pointing "outside")?
It points to the byte after the last byte of the binary in memory (i.e. once the binary is laoded, along with the BSS section, __end will point to the first byte outside the binary).
EDIT: Typo (wrote TSS instead of BSS sorry)
Last edited by mariuszp on Sat Dec 13, 2014 2:49 pm, edited 1 time in total.
mariuszp wrote:It points to the byte after the last byte of the binary in memory (i.e. once the binary is laoded, along with the TSS section, __end will point to the first byte outside the binary).
Thank you for the clarification.
In the meantime I found an [unofficial LD manual] describing the location counter. Their wording is thus:
. actually refers to the byte offset from the start of the current containing object.