title: Missing ELF symbol "var" when using GDB?
body: <p>I am able to successfully compile my program using ARM GCC. I am also able to program and run my program successfully. </p>
  
  <p>The problem comes when I'm trying to inspect the contents of a variable. GDB complains that there is a missing symbol for the variable in question.</p>
  
  <p>When I inspect the .lst file from objdump, I can see that there is no symbol for the variable.</p>
  
  <p>Here is my main.c file:</p>
  
  <pre><code>#include "project.h"
  
  const char *my_string = "tired!";
  
  int main(void) {
      while(1)
      {
          // do nothing;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>When I inspect the contents of <code>my_string</code> or at least print the address of the pointer, I get the following error:</p>
  
  <pre><code>Missing ELF symbol "my_string".
  </code></pre>
  
  <p>I tried printing the variables by executing the command: <code>info variables</code>.</p>
  
  <p>The variable <code>my_string</code> is not shown.</p>
  
  <p>I know that the main.c file is being compiled, because I can run some programs within the while loop and if I intentionally add a syntax error then the compiler will complain about it.</p>
  
  <p>If I inspect the assembler file, I can see the variable <code>my_string</code>.</p>
  
  <p>I understand that this question and issue is kind of vague, so if you need more information then let me know what to inspect. I'm trying to find some direction on where I should be looking. Thank you.</p>