Subject: toolchain/17786: ldd man page describes a (now) missing option that is (was) very useful
To: None <gnats-bugs@gnats.netbsd.org>
From: Andrew Brown <atatat@atatdot.net>
List: netbsd-bugs
Date: 07/31/2002 13:07:05
>Number:         17786
>Category:       toolchain
>Synopsis:       ldd man page describes a (now) missing option that is (was) very useful
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 31 10:08:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     TheMan
>Release:        1.6E (userland from 20020718, kernel from 20020726)
>Organization:
none
>Environment:
	
System: NetBSD this 1.6E NetBSD 1.6E (THAT) #105: Sat Jul 27 20:34:50 EDT 2002     andrew@this:/usr/src/sys/arch/i386/compile/THAT i386

>Description:

the ldd man page mentions a -f option that does not apply to elf
systems (i think it's limited to elf systems).  said option can be
used to specify the format of the output from ldd so that using a
"filter" is much easier.  eg:

% uname -r
1.3.3
% ldd /usr/bin/sed
/usr/bin/sed:
        -lc.12 => /usr/lib/libc.so.12.20 (0x4001e000)
% ldd -f "%A: -l%o %p\n" /usr/bin/sed
/usr/bin/sed: -lc /usr/lib/libc.so.12.20

but now:

% uname -r
1.6E
% ldd /usr/bin/sed
/usr/bin/sed:
         -lc.12 => /usr/lib/libc.so.12
% ldd -f "%A: -l%o %p\n" /usr/bin/sed
ldd: -f: No such file or directory
ldd: %A: -l%o %p\n: No such file or directory
/usr/bin/sed:
         -lc.12 => /usr/lib/libc.so.12

>How-To-Repeat:

above.

>Fix:

i see that ldd for elf works completely differently from the a.out
version (which set some sneaky environment variables, executed the
binary, and let ld.aout_so do all the work) in that it reads the elf
binary directly and prints stuff out.  doesn't seem like it'd be all
that hard to make it use formats.
>Release-Note:
>Audit-Trail:
>Unformatted: