title: gcc assembly to hex
body: <p>For a lab, I need to know the hex instructions for assembly that I wrote. For example I have <code>bang.s</code>:</p>
  
  <pre><code>movl 0xaaaaaaaa 0xbbbbbbbb
  push 0xcccccccc
  ret
  </code></pre>
  
  <p>Now I want to get the hex code for these instructions. How can I use <code>cc</code> and/or <code>objdump</code> to accomplish this?</p>
  
  <p>I’ve tried:</p>
  
  <pre><code>objdump -S bang.s
  </code></pre>
  
  <p>but I get "File format not recognized"</p>