title: How the basic link process works for ELF and PE
body: <p>I've always been confused about how the linker works, and it's a difficult subject to search for.</p>
  
  <p>To demonstrate my question and to provide a framework for an answer, I'll put down what I know (or think I know) so far. I may be very wrong. :)</p>
  
  <p>First, each .cpp file is built into an intermediate file (.o for Posix/ELF and .obj for Win/PE I believe). This intermediate file contains all the symbols defined by the .cpp it was built from and has instructions for what external links it needs to be properly resolved. As an extension to this, Posix systems let you combine the .o files into a .a file (Which doesn't seem to do anything more than combine? What command does this?). Is .lib the Win/PE equivalent of the Posix .a file?</p>
  
  <p>Next, the intermediate files are linked together, external dependencies resolved, and you have your executable. Am I missing any steps?</p>
  
  <p>Thanks!</p>