Subject: Re: Do ldd and file lie about some executables?
To: None <jhawk@panix.com>
From: Greg Earle <earle@isolar.Tujunga.CA.US>
List: current-users
Date: 01/20/1995 12:18:11
> 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.
>
> [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

You didn't say what system this is on.

This doesn't happen to me; I'm running "vic" on a NetBSD/SPARC 1.0 system:

isolar:1:37 % rsh -n netbsd4me ldd /usr/local/bin/vic
ldd: /usr/local/bin/vic: not a dynamic executable

isolar:1:38 % rsh -n netbsd4me "setenv DISPLAY isolar:0.0 ; \
setenv LD_TRACE_LOADED_OBJECTS 1 ; /usr/local/bin/vic"
vic: warning: not using shared memory
vic: destination address required

Note that as of the 1.0 final release (i.e., not -current), you can't use the
dynamically-linked version (i.e., that uses libg++.so.2.0) because it core
dumps.

	- Greg