title: Where are place address of globals, static and string literals by a compiler C?
body: <p>First I read the address are in .data and .text hold string literals (plus machine code I suppose) after in some other article someone said it's changed and lo longer string literals live in .text but  .rodata instead of(it's true my clang compiler output). But the .data contents mistmatch the address I printf in my C program.</p>
  
  <p>Assume this C program:</p>
  
  <pre><code>static int a;
  int main()
  {
      printf("my address = %p\n", &amp;a);
      return 0;
  }
  </code></pre>
  
  <p>output of this C program:</p>
  
  <pre><code> $ ./a.out
  my address = 0x804a01c
  </code></pre>
  
  <p>And then contents of .data section:</p>
  
  <pre><code>$ objdump -s -j .data a.out
  
  a.out:     file format elf32-i386
  
  Contents of section .data:
   804a00c 00000000 00000000 
  </code></pre>
  
  <p>There's no <code>0x804a01c</code> in this contents. Where does the address lave in?</p>