title: What is in an executable besides the raw machine instructions?
body: <p>I am on a quest to understand low-level computing. I have noticed my compiled binaries are a lot bigger then I think they should be. So I tried to build the smallest possible c program without any stdlib code as follows:</p>
  <pre class="lang-c prettyprint-override"><code>void _start()
  {
      while(1) {};
  }
  </code></pre>
  <p><code>gcc -nostdlib -o minimal minimal.c</code></p>
  <p>When I disasseble the binary, it shows me exactly what I expect, namely this exact code in three lines of assembly.</p>
  <pre class="lang-sh prettyprint-override"><code>$ objdump -d minimal
  
  minimal:     file format elf64-x86-64
  
  
  Disassembly of section .text:
  
  0000000000001000 &lt;_start&gt;:
      1000:   55                      push   %rbp
      1001:   48 89 e5                mov    %rsp,%rbp
      1004:   eb fe                   jmp    1004 &lt;_start+0x4&gt;
  </code></pre>
  <p>But my actual executable is still 13856 Bytes in size. What is it, that makes this so large? What else is in that file? Does the OS need more than these 6 Bytes of machine code?</p>
  <p><strong>Edit #1:</strong>
  The output of <code>size</code> is:</p>
  <pre class="lang-sh prettyprint-override"><code>$ size -A minimal
  minimal  :
  section              size    addr
  .interp                28     680
  .note.gnu.build-id     36     708
  .gnu.hash              28     744
  .dynsym                24     776
  .dynstr                 1     800
  .text                   6    4096
  .eh_frame_hdr          20    8192
  .eh_frame              52    8216
  .dynamic              208   16176
  .comment               18       0
  Total                 421
  </code></pre>