On Sun, 2 Jan 2000, Guy Harris wrote:
> My *guess* is that there's some kind of problem with "proto_init()" in
> "packet-gryphon.c" calling one of the routines in the main Ethereal
> image, probably due to some kind of hellish dynamic linking problem; on
> AIX, can a run-time-loaded shared library (i.e., one loaded with
> "dlopen()") call, by name, routines in the program that loaded it? If
> so, do you have to do anything special to arrange that this can happen,
> e.g. compiling the main program with special flags to that its symbols
> (or some of its symbols) are exported?
This put me on the right track. After giving myself a crash course
on the AIX linker (well, I crashed a lot), I've found at least two
was of getting the plugin to enable itself.
The trick is:
There are two tricks:
- first tell the shared module that the external symbols it needs
will turn up later (and how it will get them)
- then make sure that these symbols are exported from the main
program...
For the first trick, either you specify the symbols that will be
exported from the main program (and ethereal gracefully supplies
a file .libs/ethereal.exp that just needs "#!." added as a first
line to do this) as follows:
ld -bM:SRE -o libgryphon.so packet-gryphon.o -lc \
-bexpall -bnoentry -bI:../../.libs/ethereal.exp \
-bnolibpath
Or you enable runtime linking (but you must do this in the module *AND*
in the link of the main program) as follows (from memory):
ld -G -o libgryphon.so packet-gryphon.o -lc \
-bexpall -bnoentry
(in the man page, the option -G is described as being equivalent to
-berok -brtl -bnortllib -bnosymbolic -bnoautoexp -bM:SRE )
For the second trick, when linking the main program you add -bexpall or
-bE:.libs/ethereal.exp (*AND* -brtl if you've chosen the -G link option
for the modules).
The difficult part is trying to figure out which option you're
forgetting. Until I remembered "-bexpall" when linking ethereal, the
plugin wouldn't appear in the plugin menu (although the prevoius, badly
linked, coredumping ones did....). "dump -H" will give you a hint
about what external dependencies are required, but I don't know how
to interpret it full yet.
I'm also trying to get the Gimp plugins to work, but there are
so many libs and interdependencies that (so far) I'm completely lost.
Anyhow, I put the new-new binary package on the public download site on
www-frec.bull.com, and the package includes the script I used to manually
link the objects.
Thanks for the pointers,
Ciaran
+-------------------------------------------------------------------------+
Ciaran Deignan Tel: (France) 04 76 29 79 92
BULL XS-BU (http://www-frec.bull.com) HA and Consolidation
Mail to: Ciaran.Deignan@xxxxxxxx Bullcom: 229 79 92
PGP: B1 78 FB 88 FD 86 58 A8 89 7B 22 8C D0 E8 71 FC Fax: 229 75 18
+-------------------------------------------------------------------------+