Optional editline dependencies

Alexander E. Patrakov patrakov at ums.usu.ru
Wed Aug 1 07:33:03 PDT 2007


Randy McMurchy wrote:
> Not arguing, but what package is actually linked to libedit (I'm
> curious more than anything)? Some folks have the wrong impression
> that because something is listed in the output of ldd for a particular
> binary, it is used by that binary. That is an incorrect assumption.
>
> For example, just because libedit is listed in ldd output of sftp,
> it does *not* mean it is used (not even pulled in directly) by
> sftp. It only means that one of *any* of the packages linked to
> sftp is linked directly to libedit.
>   
patrakov at home:~$ readelf -a /usr/bin/sftp | grep NEEDED
 0x00000001 (NEEDED)                     Shared library: [libresolv.so.2]
 0x00000001 (NEEDED)                     Shared library: 
[libcrypto.so.0.9.8]
 0x00000001 (NEEDED)                     Shared library: [libutil.so.1]
 0x00000001 (NEEDED)                     Shared library: [libz.so.1]
 0x00000001 (NEEDED)                     Shared library: [libnsl.so.1]
 0x00000001 (NEEDED)                     Shared library: [libcrypt.so.1]
 0x00000001 (NEEDED)                     Shared library: 
[libgssapi_krb5.so.2]
 0x00000001 (NEEDED)                     Shared library: [libkrb5.so.3]
 0x00000001 (NEEDED)                     Shared library: [libk5crypto.so.3]
 0x00000001 (NEEDED)                     Shared library: [libcom_err.so.2]
 0x00000001 (NEEDED)                     Shared library: [libedit.so.2]
 0x00000001 (NEEDED)                     Shared library: [libncurses.so.5]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]

So sftp is linked to libedit directly. Moreover, it uses symbols from 
libedit:

patrakov at home:~$ nm -D /usr/lib/libedit.so.2 | grep el_init
000107e7 T el_init
patrakov at home:~$ readelf -a /usr/bin/sftp | grep el_init
00013494  00003d07 R_386_JUMP_SLOT   00000000   el_init
    61: 00000000  2501 FUNC    GLOBAL DEFAULT  UND el_init

-- 
Alexander E. Patrakov



More information about the blfs-dev mailing list