title: How much runtime overhead is incurred by the loading of shared libraries on Linux
body: <p>I am searching for some statistics regarding the runtime time overhead that occurs when a program is loaded by using the runtime linker (e.g. <code>ld.so</code>). I am not an expert for how the runtime linker works but as I understand it usually performs the following actions:</p>
  
  <ul>
  <li>Searching for shared libraries in the well known paths, or in the  <code>LD_LIBRARY_PATH</code></li>
  <li>Loading the shared libraries</li>
  <li>Symbol resolution for used functions</li>
  </ul>
  
  <p>So when I start a program through a GUI or through a command line, at some point a system call to <code>exec</code> will happen and the requested program is started. Lets take a quick look to what happens then:</p>
  
  <ol>
  <li><code>Exec(myprogram)</code></li>
  <li>Operating system loads <code>myprogramm</code> into memory</li>
  <li>Operating system turns over execution to <code>_start</code></li>
  <li>Some initialization happens and the runtime linker is run</li>
  <li><code>main()</code> is called</li>
  </ol>
  
  <p>Assuming that the above list is correct and I did not leave out any major steps I would be interested in two things:</p>
  
  <ol>
  <li>What is the overhead of step 4. according to theory?</li>
  <li>How can I determine in practice the overhead of step 4. (e.g. for real programs such as Firefox or Chrome)?</li>
  </ol>