title: How to create a Linux ELF with only a NOP?
body: <p>I am trying to create a simple 64-bit ELF file on Linux without using a compiler, just out of curiosity. For simplicity, I only need it to NOP (0x90).</p>
  <p>My current file can be read by &quot;readelf&quot;, and its output seems OK. When I execute it, however, I am greeted with a segfault.</p>
  <p>The file in question (unformatted so it can be copy-pasted easier):</p>
  <pre><code>7F 45 4C 46 02 01 01 00 00 00 00 00 00 00 00 00 02 00 3E 00 01 00 00 00 78 00 40 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 38 00 01 00 00 00 00 00 00 00 01 00 00 00 05 00 00 00 78 00 00 00 00 00 00 00 78 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 90
  </code></pre>
  <p>GDB says segfault at address 0x400079, although the entry point is at 0x400078 and size of the file is 1 byte for the NOP, so why does that non-reserved memory get executed?</p>
  <p>Bonus: why do a lot of executables start their code at large virtual addresses, and not at 0x0?</p>