Ethereal-dev: Re: [Ethereal-dev] Re: tethereal and ethereal

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Tue, 17 Sep 2002 12:41:43 -0700
On Tue, Sep 17, 2002 at 12:07:19PM -0700, Curtis Doty wrote:
> Has anyone tried subsuming tethereal into ethereal? So one binary is 
> built, but with option to run without Gdk.

It is not necessarily the case that such an option can be implemented; I
think many UNIX dynamic linking mechanisms attempt, at program startup
time, to load all libraries with which the program regardless of whether
the program is going to call those routines or not.

In particular, that's how the dynamic linking mechanism in FreeBSD 3.4,
at least, works.  If you compile the program

	#include <math.h>

	int
	main(int argc, char **argv)
	{
		if (argc == 27)
			printf("%g\n", cos(17.324));
		else
			printf("No\n");
		return 0;
	}

which has an option to run without libm - i.e., don't supply it with 26
arguments (the 27th is the path to the program) and it won't use any
libm routines - and temporarily arrange that there's no
"/usr/lib/libm.so.2", and try to run the program, you get

	/usr/libexec/ld-elf.so.1: Shared object "libm.so.2" not found

I suspect that's the behavior you'd get on most systems with a SunOS
4.x-derived shared library mechanism, e.g. the BSDs, Linux
distributions, and Solaris and other SVR4-based systems.  You might get
it with other UNIX systems as well.

The Win32 dynamic linking mechanism may work the same way.

So that version of Tethereal would require that you have GTK+ installed,
which would mean it no longer serves the purpose for which at least some
people use it (running it on machines that don't have X11 installed).