title: Where are static values stored in assembly
body: <p>Here is a simple C code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int a = 5;
  
  static int b = 20;
  
  int main(){
  
   int c = 30;
  
   return 0;
  }
  </code></pre>
  
  <p>Compiled to assebly with no optimization:</p>
  
  <pre><code>    .section    __TEXT,__text,regular,pure_instructions
      .macosx_version_min 10, 13
      .globl  _main                   ## -- Begin function main
      .p2align    4, 0x90
  _main:                                  ## @main
      .cfi_startproc
  ## %bb.0:
      pushq   %rbp
      .cfi_def_cfa_offset 16
      .cfi_offset %rbp, -16
      movq    %rsp, %rbp
      .cfi_def_cfa_register %rbp
      xorl    %eax, %eax
      movl    $0, -4(%rbp)
      movl    $30, -8(%rbp)
      popq    %rbp
      retq
      .cfi_endproc
                                          ## -- End function
      .section    __DATA,__data
      .globl  _a                      ## @a
      .p2align    2
  _a:
      .long   5                       ## 0x5
  
  
  
  </code></pre>
  
  <p>My question is where is <code>static int b = 20;</code> in the above assembly?
  I know they are supposed to be in the global section of the memory but I cannot find it in the compiled version.</p>