tcpdump mailing list archives

Re: pcap shared libraries: inconsistencies across Linux machines


From: Guy Harris <guy () alum mit edu>
Date: Wed, 13 Jun 2007 15:18:02 -0700


On Jun 13, 2007, at 9:32 AM, Jonathan Gruenhut wrote:

To be honest, at this point I’m totally mystified. My (naive) understanding of shared objects in Linux was that as long as the major version number was the same, the loader should look up whatever is present on the system.

That's how a *sane* shared library mechanism would work, and, as far as I know, it's how the SVR4/ELF shared library mechanism was intended to work. That's the shared library mechanism after which the shared library mechanisms in Linux and the ELF-based BSDs are modeled, as far as I know.

So, if you link with "-lpcap", the executable should be bound to libpcap.so.0, *NOT* libpcap.so.0.8.3 or libpcap.so.0.9.4 or whatever.

You *did* link with "-lpcap", not "-lpcap.0.8.3" or something such as that, right?

ldd output:

[jonathan@computer94 ~]$ ldd program83
       linux-gate.so.1 =>  (0x00422000)
       libnsl.so.1 => /lib/libnsl.so.1 (0x001f6000)
       libpcap.so.0.8.3 => /usr/lib/libpcap.so.0.8.3 (0x00195000)
       libc.so.6 => /lib/libc.so.6 (0x00b47000)
       /lib/ld-linux.so.2 (0x00178000)

It sounds as if program83 is bound to the right versions of libnsl and libc - i.e., it appears to be bound to versions with *ONLY* the major version number, *NOT* versions with the full version number.

Are the versions of libpcap on the system the ones that came with the system, or did you build and install your own shared libpcap library in /usr/lib?

The so files:

[jonathan@computer94 ~]$ ls -l /usr/lib/*pcap*
lrwxrwxrwx 1 root root 12 Jun 13 20:27 /usr/lib/libpcap.so -> libpcap.so.0 lrwxrwxrwx 1 root root 14 Jun 13 21:22 /usr/lib/libpcap.so.0 -> libpcap.so.0.9 lrwxrwxrwx 1 root root 16 May 3 19:03 /usr/lib/libpcap.so.0.9 - > libpcap.so.0.9.4
-rwxr-xr-x 1 root root 168544 Jul 13  2006 /usr/lib/libpcap.so.0.9.4

What do "ls -l /usr/lib/libc*" and "/usr/lib/libnsl*" print?

-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: