title: How to fetch the end address of my code
body: <p>I'm writing a real-time operation system from scratch for a course project. I want to know the end address of my code after I download it to the chip, because I am planning to use the free memory for stack space and I need make sure that I won't overwrite the existing code.</p>
  
  <p>I heard about __end variable provided by GCC is the end of the code, but I have no idea about what is the meaning of __end and how to use it in my code. Could anyone explain it a little bit or provide links to some materials, cos I couldn't google __end?</p>
  
  <p>Thanks a lot.  </p>