[uClibc]still having problems with dlopen()

Joel Coltoff joel at wmi.com
Mon Sep 23 16:38:44 UTC 2002


Hi,

I'm still getting a segfault when I try and use dlopen(). My toolchain is
built using binutils-2.12.1, gcc-3.l2 and uClibc-0.9.15 My system is mipsel
and the kernel is 2.4.18.

I compile my test case like this (these are from the perl configure script)

    gcc -fno-strict-aliasing -fpic -c dyna.c
    gcc -o fred -fno-strict-aliasing -fpic -rdynamic fred.c -ldl
    gcc -o dyna.so -shared dyna.o

They simply do a dlopen() and then a dlsym(). If the last step is the one
below there is no segfault.

    ld -o dyna.so -shared dyna.o

I put traces in dlib.c (.../uClibc-0.9.15/ldso/libdl) and it dies in
_dlopen() trying to do

    if (tpnt->dynamic_info[DT_INIT]) {
	dl_elf_init = (int (*)(void)) (tpnt->loadaddr +
	    tpnt->dynamic_info[DT_INIT]);
// It dies on this call
	(*dl_elf_init) ();
    }

tpnt-> loadaddr = 2ab87000 and tpnt->dynamic_info[DT_INIT] = 6c8.

The 6c8 I can see if I do an "nm" on my shared object. The other
number I assume is a virtual address. At this point I'm stuck and
don't know what to do next. I'm working on getting gdb running but
haven't had much luck. Does anyone have a suggestion for something
to try? I'm assuming the call that fails is the init code in one
of the startup modules. What other conditions can I use to test this
code? All my other apps compiled with this toolchain run but I don't
know if that code is being executed.

Thanks.

-- 
Joel Coltoff

I was gratified to be able to answer promptly, and I did. I said I
didn't know. -- Mark Twain




More information about the uClibc mailing list