title: "file not recognized" while using the GNU linker
body: <p>I'm probably doing something wrong, being a newbie. Could you please help me out?</p>
  
  <p>I've written a simple Hello World program in C called hello.c, and ran the following command:</p>
  
  <pre><code>gcc -S hello.c
  </code></pre>
  
  <p>That produced <code>hello.s</code>. Then I used that file with GNU assembler, <code>as</code>:</p>
  
  <pre><code>as hello.s
  </code></pre>
  
  <p>Which produced a non-executable <code>a.out</code>, which still needs to be linked, I understand?</p>
  
  <p>I try to link it by using <code>ld</code>, like so:</p>
  
  <pre><code>ld a.out
  </code></pre>
  
  <p>But get the following error:</p>
  
  <pre><code>a.out: file not recognized: File truncated
  </code></pre>
  
  <p>And <code>ld</code> deletes my file.</p>
  
  <p>This is an x86 Ubuntu system. What am I doing wrong? Many thanks!</p>