title: referencing global variables from inline assembly in gcc
body: <p>I have the problem where the linker generates undefined reference errors
  from the inline assembly code.</p>
  
  <pre><code>int global_var = 0;
  void myfunc()
  {
      asm(".intel_syntax noprefix\n");
      asm("lea eax, global_var\n");
  }
  </code></pre>
  
  <p>I am compiling with -masm=intel and with no optimizations or anything, using GCC 3.4.2
  If anyone suffered from this inconvenience too please assist.</p>