Subject: Do ldd and file lie about some executables?
To: None <current-users@NetBSD.ORG>
From: John Hawkinson <jhawk@panix.com>
List: current-users
Date: 01/20/1995 05:17:13
I've just run across a case of a dynamically linked executable
that both /usr/bin/file and /usr/bin/ldd think is static, but
wasn't linked statically, and doesn't appear to run statically.

The program in question is vic (a multicast video client), which
uses g++. I nuked the build tree before noticing the bug, so
I don't have lots of information. If necessary, I can go
and rebuild it.

Anyway:

[I-See-Everything-Twice!jhawk] /afs/sipb/project/mbone/bin> ldd vi 
ldd: vi: No such file or directory
[I-See-Everything-Twice!jhawk] /afs/sipb/project/mbone/bin> ldd vic
ldd: vic: not a dynamic executable

However:

[I-See-Everything-Twice!jhawk] /afs/sipb/project/mbone/bin> setenv LD_TRACE_LOADED_OBJECTS 1
[I-See-Everything-Twice!jhawk] /afs/sipb/project/mbone/bin> ./vic
        -lXext.6 => /usr/X11/lib/libXext.so.6.0 (0x100fd000)
        -lX11.6 => /usr/X11/lib/libX11.so.6.0 (0x10105000)
        -lg++.2 => /usr/lib/libg++.so.2.0 (0x1017d000)
        -lm.0 => /usr/lib/libm.so.0.0 (0x101ce000)
        -lc.12 => /usr/lib/libc.so.12.0 (0x101db000)
        -lcurses.2 => /usr/lib/libcurses.so.2.1 (0x10234000)
[I-See-Everything-Twice!jhawk] /afs/sipb/project/mbone/bin> 

Is this a known problem (perhaps pertaining to g++?)?

I also wonder if it somehow relates to the size of the executable:

-rwxr-xr-x  1 jhawk  wheel  1413120 Jan 20 05:10 vic

Thanks...

--
John Hawkinson
jhawk@panix.com