title: How to extract a few functions out of a compiled ELF-executable (no disassembly)?
body: <p>I'm dealing with a large executable, for which I do not have sources (long story).</p>
  
  <p>I'd like to extract the binary code of several functions from it -- and try to call them from my own program. The functions I'm looking for were all compiled from the same source-file (using gcc on Linux), if it matters.</p>
  
  <p>I can see the function's binary code using objdump. Is there any way I could convince the tool to dump a functions' binary code -- with nothing else and without disassembling?</p>
  
  <p>Basically, if the C-file, where the functions were defined, was called foo.c, I want to get foo.o (I'd actually prefer foo.So, but that's not going to exist in an executable). Can it be done with objdump, readelf or some such?</p>
  
  <p>The functions are self-contained, if it matters.</p>
  
  <p>Thanks!</p>