[comp.unix.aix] analog to SunOS ldd in AIX 3.1?

schorr@ead.dsa.com (Andrew J. Schorr) (02/26/91)

Is there a command in AIX 3.1 that does the same
thing as ldd in SunOS 4+?  For those who are unfamiliar
with SunOS, ldd (when applied to a program) lists which 
shared libraries would be used if the program were executed.
(Presumably, ldd is an acronym for List Dynamic Dependencies.)
This is useful for verifying which versions of shared libraries
are being linked at run-time (e.g. for figuring out if you're
using the development version that is in a LIBPATH directory,
or the installed one in /usr/local/lib).

Perhaps the answer is somewhere in Info-Explorer.  If so,
pointers would be appreciated... (I would RTFM, but life
is so short).

Thanks,
Andy

P.S.  If this command does not exist, I feel strongly that
it should be included in a future release.

rudy@chukran.austin.ibm.com (03/02/91)

The closed thing to determine which libraries will be
referenced when an executable is loaded is

dump -n a.out

and look for the import string table.
*********************************************************************
IBM AIX Porting Center  | RSCS: CHUKRAN at AUSTIN 
11400 Burnet Rd.        | AWDnet: rudy@chukran.austin.ibm.com    
Internal ZIP 2830       | internet: chukran@austin.iinus1.ibm.com
Austin, Texas 78758     | Voice: 512-838-4674  Tieline: 678-4674
*********************************************************************

marc@stingray.austin.ibm.com (Marc J. Stephenson/140000;1C-22) (03/04/91)

As already mentioned, dump -n is probably as analagous as it
gets to what you described ldd doing (I don't have a Sun or
a Sun manual handy to know for sure).  Anyway, I thought that
I would mention that the map command in dbx will give you
information about shared libraries as well:

$ dbx /usr/lib/banner
dbx version 3.1 for AIX.
Type 'help' for help.
reading symbolic information ...
(dbx) map
Entry 1:
   Object name: banner
   Text origin:     0x10000000
   Text length:     0x12b1
   Data origin:     0x2003fa00
   Data length:     0x6fb
   File descriptor: 0x7

Entry 2:
   Object name: /lib/libc.a
   Member name: shr.o
   Text origin:     0xd0001000
   Text length:     0x96fbe
   Data origin:     0x20000400
   Data length:     0x3e4a8
   File descriptor: 0x8

(dbx) q

As your program dynamically loads and unloads, this information will
change as well.  Not exactly what you were asking about, but useful
nonetheless.

-- 
Marc Stephenson		      IBM PSPA (Personal System Programming - Austin,TX)
DISCLAIMER: The content of this posting is independent of official IBM position.
marc@stingray.austin.ibm.com 	VNET: MARC at AUSVMQ  	IBM T/L: 793-3796