Subject: Re: dlopen'ing a plugin that calls functions in the parent...
To: Oleg Polianski <Oleg.Polianski@clear.co.nz>
From: Jasper Wallace <email@example.com>
Date: 09/10/2001 12:59:09
-----BEGIN PGP SIGNED MESSAGE-----
On 10 Sep 2001, Oleg Polianski wrote:
> Jason R Thorpe <firstname.lastname@example.org> writes:
> Hi there
> It could be somewhat very similar but looks slightly different (another
> symnum) and I still don't understand what exactly could be wrong. I'm trying
> to preload shared object which simply overrides some entry points in
> `libgdk.so' and does rendering properly (support for anti-aliasing); it
> tries to access some code from `libXft.so' (which is part of locally built
> XFree86 4.1.0) as well. But when I start the program (any gtk-based program
> which uses font widgets), I get the following:
> simoom p5 /opt/tmp/gdkxft-1.0 10211% LD_PRELOAD=/usr/local/lib/libgdkxft.so gfontsel
> /usr/local/lib/libgdkxft.so: Undefined PLT symbol "XftFontOpenXlfd" (reloc type = 7, symnum = 67)
> I recompiled both, `libXft' and `gdkxft' with `--export-dynamic' but still
> have no success. I went through the code, it doesn't look strange - only
> dlopen/dlsym/indirect call sequences, i.e. it doesn't have any callbacks and
> so on. Still wondering, what could be wrong, any ideas are greatly
nm /path/to/libXft.whatever | grep XftFontOpenXlfd
are you using -Wl,--rpath /path/to/libXft/ when you link libgdkxft.so?
> > On Wed, Sep 05, 2001 at 09:55:06PM +0100, Jasper Wallace wrote:
> > > I'm trying to get the wirless plugin for gkrellm to work under
> > > NetBSD 1.5.2.
> > >
> > > After digging around with gdb the call to dlopen() on the plugin fails with
> > > (as reported dy dlerror()):
> > >
> > > Error: /usr/home/jasper/.gkrellm/plugins/wireless.so: Undefined PLT symbol
> > > "gkrellm_draw_decal_text" (reloc type = 7, symnum = 31)
> > >
> > > gkrellm_draw_decal_text is a function in gkrellm (and gkrellm is NOT
> > > striped).
> > gkrellm needs to be linked with the -E (--export-dyanmic) option. That
> > should fix your problem.
> > Any program which opens a shared object that needs to call back into
> > the parent needs this option. I guess maybe it's the default on Linux,
> > or something, because lots of programs fail to include it in their
> > Makefiles.
> > --
> > -- Jason R. Thorpe <email@example.com>
When Ted's fixing your computer at a quarter past one, eat your
Whopper with cheese in his face. He functions better when he's
slightly dizzy from hunger.
[see: http://sysday.tripod.com/time.htm] [0x2ECA0975]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (NetBSD)
Comment: For info see http://www.gnupg.org
-----END PGP SIGNATURE-----