title: Is there a way to get gcc to output raw binary?
body: <p>Is there a set of command-line options that will convince gcc to produce a flat binary file from a self-contained source file?  For example, suppose the contents of foo.c are</p>
  
  <pre><code>static int f(int x)
  {
    int y = x*x;
    return y+2;
  }
  </code></pre>
  
  <p>No external references, nothing to export to the linker. I'd like to get a small file with just the machine instructions for this function, without any other decoration. Sort of like a (DOS) .COM file except 32-bit protected mode.</p>