title: missing symbols in valgrind stacktrace
body: <p>I'm using valgrind to debug a binary which uses loadable libraries via dlopen.
  On debian stable the stacktrace does not contain symbols for calls inside the loadable lib.</p>
  
  <pre><code>| | -&gt;11.55% (114,688B) 0x769492C: ???
  | | | -&gt;11.55% (114,688B) 0x7697289: ???
  | | |   -&gt;11.55% (114,688B) 0x769806F: ???
  | | |     -&gt;11.55% (114,688B) 0x419812: myfunc (main.c:1010)
  </code></pre>
  
  <p>Valgrind on debian unstable works fine and the symbols are properly resolved. So I started looking what is different. 
  I have these packages on both systems (valgrind was updated to 3.7 from unstable):</p>
  
  <pre><code>ii  valgrind                      1:3.7.0-1+b1
  ii  libtool                       2.2.6b-2
  ii  gcc                           4:4.4.5-1
  ii  binutils                      2.20.1-16
  </code></pre>
  
  <p>The libs are not stripped and contain debuginfo:</p>
  
  <pre><code> ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=0x33ffd210859178c15bb3923c5491e1a1b6065015, not stripped
  </code></pre>
  
  <p>Looking closer I noticed that the size of the libraries are different, on debian unstable the lib is slightly bigger. Comparing them with readelf, the size of the debug info is bigger.</p>
  
  <pre><code>  [26] .debug_aranges    PROGBITS        0000000000000000 00a74c 000090 00      0   0  1
    [27] .debug_pubnames   PROGBITS        0000000000000000 00a7dc 000385 00      0   0  1
    [28] .debug_info       PROGBITS        0000000000000000 00ab61 00512f 00      0   0  1
    [29] .debug_abbrev     PROGBITS        0000000000000000 00fc90 0006e2 00      0   0  1
    [30] .debug_line       PROGBITS        0000000000000000 010372 002314 00      0   0  1
    [31] .debug_str        PROGBITS        0000000000000000 012686 0019d3 01  MS  0   0  1
    [32] .debug_loc        PROGBITS        0000000000000000 014059 000f24 00      0   0  1
    [33] .debug_macinfo    PROGBITS        0000000000000000 014f7d 179082 00      0   0  1
    [34] .debug_ranges     PROGBITS        0000000000000000 18dfff 000060 00      0   0  1
  </code></pre>
  
  <p>This makes me think that something is missing from the debug info section from the binaries built on debian stable. Now my question is: why and how are the binaries different? The tools (gcc, libtool, binutils) used in the build are the same, including the compiler/linker flags and commands (I checked with diff on make's output).</p>
  
  <p><strong>Update:</strong>
  The debug_info section size difference came from the fact that the full path of the source file is stored there as well and the build home was different. Also there are different openssl versions on unstable/stable which added some different symbols to the debug_info section. Hence the difference in debug_info size.</p>
  
  <p>Running valgrind in debug mode (-d -v -v) shows that it reads symbols from the loadable lib in both cases:</p>
  
  <pre><code>--19837-- Reading syms from /usr/lib/myplugin.so (0x6c62000)
  </code></pre>