title: __stack_size__, __stack_end__ symbols in 'C'
body: <p>Is there a direct method in which the values of the <strong>stack_start</strong> and <strong>stack_end</strong> symbols can be referenced in a 'C' function? I can do this using a bit of assembler to read each symbol and place it to a variable that has been given the 'used' attribute. For example.</p>
  
  <pre><code>static __attribute__((used)) UI_32 StkStart;
  
  __asm__
  (
      "LDR R0, =__stack_start__ \n"
      "LDR R1, =StkStart\n"
      "STMIA.W R1, {R0}\n"
  );
  </code></pre>
  
  <p>Is there a way to avoid the use of assember here?</p>
  
  <p>The reason that I need to do this is that my stack region is initialised to a particular pattern in the startup module and in order to determine how much of the stack has been used I can walk through the stack memory checking for changes to the original pattern.</p>