[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lib inclusion



Hi there,

> I don't know; it shouldn't.  I can't say more without enough
> details to let me reproduce the problem you see.

Oki, lets see then.
Take a really simple C++ program like:

int main()
{
  vector<string> vStr;
  string sTmp = "blaha";

  vStr.push_back( sTmp );
  
  return 0;
}

With simple compilation like:

g++ -o stl_plain stl.cc
g++ -static -o stl_static stl.cc
g++ -Wl,-Bstatic,-lm,-Bdynamic -o stl_mixed stl.cc

I would get 'ldd' to report:

stl_plain:
        libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0x40028000)
        libm.so.6 => /lib/libm.so.6 (0x40075000)
        libc.so.6 => /lib/libc.so.6 (0x40097000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

stl_static:
        not a dynamic executable

stl_mixed:
        libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0x40028000)
        libm.so.6 => /lib/libm.so.6 (0x40075000)
        libc.so.6 => /lib/libc.so.6 (0x40097000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Which in the first two cases is just like expected, but shouldnt the third leave out libm ?
(Or libstdc++ when I try that one)

(NOTE:
A more advanced example, compiled inside the dev_etrax environment produces the exact same result, with :
'readelf-cris -d <binary>'producing the result:
 0x00000001 (NEEDED)                     Shared library: [libstdc++-2.so.3]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 ...
)

Am I missing something obvious, or maybe you need more information ?

Regards - JB