This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

dlopen problems



I am having a hard time getting some perl modules to work because it seems
that the dependency resolutions in the dynamic linker are not doing the
right thing.

Basically you have two libraries (lib1.so and lib2.so) that are both
exporting the same symbol foo(). Then you have a program (main) that is
linked dynamically against the first library, lib1. You have another
library (module.so) linked against lib2 that acts like a loadable module.
The programs does a dlopen on the module and calls a function() in the
module. That function from the module depends on the foo() function from
the library it is linked against (lib2). But instead of calling the
lib2.so:foo() we end up calling the lib1:foo() from the module, because
that is already resolved and ready to use.

I have attached a small test case that shows up this broken behavior. What
is bad is that no matter what I do I can not manage to get module.so to
call the right foo() function - linking in statically lib2 into module.so
does not help.

Cristian
--
----------------------------------------------------------------------
Cristian Gafton    --     gafton@redhat.com     --       Red Hat, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 UNIX is user friendly. It's just selective about who its friends are.


testlib.tar.gz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]