[gst-devel] Undefined symbols

Julio M. Merino Vidal jmmv at menta.net
Tue Apr 6 03:35:18 CEST 2004


On Sun, 4 Apr 2004 15:46:21 +0200 (DFT)
Benjamin Otte <in7y118 at public.uni-hamburg.de> wrote:

> On Sun, 4 Apr 2004, Julio M. Merino Vidal wrote:
> 
> > But how can the function know which other modules does it need to load to get
> > one working properly?  It can't know which dependencies are needed if they are
> > recorded nowhere...
> >
> It's recorded in the plugin_init function of the plugin. It does a
> gst_library_load of the plugins it requires.

So, if I understood it correctly, here is what's going on when I do
'gst-inspect esdsink':

1) gst-inspect finds and opens the esdsink plugin, which is the libgstesd.so
   shared file.
2) It searches for the plugin_init function and calls it.
3) plugin_init from libgstesd.so does a gst_library_load to load the
   libgstaudio.so plugin, so that it can later call its functions.
4) esdsink calls a function from libgstaudio, and should work because the
   library has been loaded.  But instead, it fails.

Am I right?  If so, I've prepared a simple testcase that tries to simulate
this behavior (w/o using any of the gst/glib code, just plain calls to
dlopen and other functions).  You can find it here (less than 1kb):

	ftp://ftp.NetBSD.org/pub/NetBSD/misc/jmmv/plugins-tc.tar.gz

This fails under NetBSD, as seen below:

[dawn plugins-tc] $ ./main
plugin1 initialized
test function from plugin1
./plugin1.so: Undefined PLT symbol "plugin2_func" (symnum = 26)

But using LD_PRELOAD:

[dawn plugins-tc] $ LD_PRELOAD=./plugin2.so ./main
plugin1 initialized
test function from plugin1
test function from plugin2

I expected it to work properly under Linux (because I tried gst-plugins,
and worked); but it failed too...

So maybe I've got the wrong idea of how the whole thing works.  Or maybe
something is broken.

Note that in another message i suggested linking modules against its
dependancies.  I tried to do this with some, and got them working... but
libtool warns that this is not portable... so better forget it :(

Comments?

Thanks very much.

-- 
Julio M. Merino Vidal <jmmv at menta.net>
The NetBSD Project - http://www.NetBSD.org/




More information about the gstreamer-devel mailing list