title: Using global variables declared in C, in Arm assembly
body: <p>I have a C file which declares a global variables. This file will be compiled together with some ARM assembly files.</p>
  
  <pre><code>int foo;
  
  void call_asm(void);
  
  int main(void) {
      call_asm();
      return foo;
  }
  </code></pre>
  
  <pre><code>call_asm:
      ...
  </code></pre>
  
  <p>I tried using the <a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0203j/Cihcciij.html" rel="nofollow noreferrer">link from the arm infocenter</a> but the compiler (<code>arm-linux-gnueabi-gcc</code>) is telling me that "import" is an undefined instruction.</p>
  
  <p>Can I simply do something like:</p>
  
  <pre><code>LDR    r0, =GLOBAL_VAR
  </code></pre>
  
  <p>How can I use the global variables defined in the C file in assembly?</p>