title: gcc: segmentation fault when compiling with nostdlib
body: <p>I'm experimenting with entry points and got a segfault. </p>
  
  <p>prog.c:</p>
  
  <pre><code>int main() {
      return 0;
  }
  </code></pre>
  
  <p>compiling and linking with:</p>
  
  <pre><code> gcc -Wall prog.c -nostdlib -c -o prog.o
   ld prog.o -e main -o prog.out
  </code></pre>
  
  <p>objdump:</p>
  
  <pre><code>Sections:
  Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         0000000b  00000000004000b0  00000000004000b0  000000b0  2**2
                CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .eh_frame     00000038  00000000004000c0  00000000004000c0  000000c0  2**3
                CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .comment      0000001c  0000000000000000  0000000000000000  000000f8  2**0
                CONTENTS, READONLY
  
  Disassembly of section .text:
  00000000004000b0 &lt;main&gt;:
   4000b0:    55                      push   %rbp
   4000b1:    48 89 e5                mov    %rsp,%rbp
   4000b4:    b8 00 00 00 00          mov    $0x0,%eax
   4000b9:    5d                      pop    %rbp
   4000ba:    c3                      retq   
  </code></pre>
  
  <p>Valgrind output:</p>
  
  <pre><code> Access not within mapped region at address 0x0
  </code></pre>