title: How to use a global variable in gcc inline assembly
body: <p>I am trying to use inline assembly like this, for a global variable, but the compiler gives an error by saying undefined reference to <strong>saved_sp</strong>.</p>
  
  <pre><code>__asm__ __volatile__ (
          "movq saved_sp, %rsp\n\t" );
  </code></pre>
  
  <p><strong>saved_sp</strong> is declared as <code>static long saved_sp</code> globally (for a file that is). What mistake am I doing here?</p>