title: Where does constant local variable array go in memory for a 'C' program
body: <p>I am using GCC 4.8.1 and it doesn't seem to store const variable local to main in DATA segment. Below is code and memory map for 3 such programs: </p>
  
  <p>Code 1: </p>
  
  <pre><code>int main(void) 
  { //char a[10]="HELLO"; //1 //const char a[10] = "HELLO"; //2 
  return 0; 
  } 
  
  MEMORY MAP FOR ABOVE: 
  text     data    bss     dec     hex    filename 
  7264     1688 1040   9992    2708   a.exe 
  </code></pre>
  
  <p>CODE 2:</p>
  
  <pre><code>int main(void)
  {
      char a[10]="HELLO";
      //const char a[10] = "HELLO";
      return 0;
  }
  
  MEMORY MAP FOR 2: 
  text     data    bss     dec     hex    filename 
  7280     1688    1040    10008   2718 a.exe 
  </code></pre>
  
  <p>CODE 3:</p>
  
  <pre><code>int main(void)
  {
      //char a[10]="HELLO";
      const char a[10] = "HELLO";
      return 0;
  }
  
  MEMORY MAP FOR 3 :
   text    data    bss     dec     hex    filename 
  7280     1688    1040    10008   2718   a.exe
  </code></pre>
  
  <p>I do not see any difference in data segment between 3 codes. Can someone please explain this result to me.</p>
  
  <p>Thanks in anticipation!</p>