title: ld linker question: the --whole-archive option
body: <p>The only real use of the <code>--whole-archive</code> linker option that I have seen is in creating shared libraries from static ones. Recently I came across Makefile(s) which always use this option when linking with in house static libraries. This of course causes the executables to unnecessarily pull in unreferenced object code. My reaction to this was that this is plain wrong, am I missing something here ? </p>
  
  <p>The second question I have has to do with something I read regarding the whole-archive option but couldn't quite parse. Something to the effect that  <code>--whole-archive</code> option should be used while linking with a static library if the executable also links with a shared library which in turn has (in part) the same object code as the static library. That is the shared library and the static library have overlap in terms of object code. Using this option would force all symbols(regardless of use) to be resolved in the executable. This is supposed to avoid object code duplication. This is confusing, if a symbol is refereed in the program it must be resolved uniquely at link time, what is this business about duplication ? (Forgive me if this paragraph is not quite the epitome of clarity)</p>
  
  <p>Thanks </p>