title: position of gcc -l option
body: <p>The man page of <code>gcc</code> has a section to describe position of <code>-l</code> option:</p>
  
  <blockquote>
    <p>It makes a difference where in the command you write this option; the linker searches and processes libraries and object
               files in the order they are specified.  Thus, <code>foo.o -lz bar.o</code> searches library <code>z</code> after file <code>foo.o</code> but before <code>bar.o</code>.  If <code>bar.o</code>
               refers to functions in <code>z</code>, those functions may not be loaded.</p>
  </blockquote>
  
  <p><strong>The question is:</strong></p>
  
  <p>If linker search &amp; process file list in order, then shouldn't the command specify <code>-l</code> option before any source code &amp; object file, instead of after them, so that the library could be used for all object files.</p>