hey guys,
i have a problem that i'm not quite sure how to solve.
here's an example of what's happening:
- mkdir /a
- mount -F lofs / /a
- LD_PRELOAD=/a/lib/foobar1.so /foo
- the application does chroot(/a)
- the application does dlopen(foobar2.so), but foobar2.so was compiled
with a dependancy on foobar1.so.
- the linker loads /lib/foobar1.so even though it's already loaded.
so now i have the same library (albiet opened via two different
paths) loaded into my process twice:
/a/lib/foobar1.so
/lib/foobar1.so
is there any way i can get the linker to realize that this library is
already loaded?
i tried dlopen'ing foobar2.so from the initalization routine of
foobar1.so to basically pre-load it, but the linker didn't like that.
my only other idea is to remove the direct calls from foobar2.so
to foobar1.so and then lookup the functions in foobar1.so that i
want to call using dlsym().
suggestions? (a recommendation to get my head check could be
a valid suggestion.)
ed