Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
158 user(s) are online (141 user(s) are browsing Forums)

Members: 1
Guests: 157

vagappc, more...

Support us!

Headlines

 
  Register To Post  

libdl.so:dlopen
Just can't stay away
Just can't stay away


See User information
dlopen() crashes immediately when I use it in SRec (something to do with initdl()):
lame_so.handle = dlopen("SOBJS:libmp3lame/libmp3lame.so", 0);

I've posted the crashlog here.

It also happens when I compile with libdl.a instead of libdl.so.

Go to top
Re: libdl.so:dlopen
Just can't stay away
Just can't stay away


See User information
@salass00

If I use the libdl.so included with the OS I get the following output from sashimi before dlopen() returns NULL for failure ( where is this coming from?):
Quote:

dlopen()
my_init: IExec = 0x0
handle: 00000000
dlopen()
my_init: IExec = 0x1c924cc
handle: 00000000
dlopen()
my_init: IExec = 0x1c924cc
handle: 00000000
dlopen()
my_init: IExec = 0x1c924cc
handle: 00000000


Everything except the "my_init: ??" stuff is from my program.

It doesn't crash but from what I can tell it doesn't try to open the .so file either (at least it doesn't show up with Snoopy).

Go to top
Re: libdl.so:dlopen
Amigans Defender
Amigans Defender


See User information
@salass00

Is the .so definitely compiled with -fPIC and linked with -shared?

Does the example in the archive work if you compile and run it?

Chris

Go to top
Re: libdl.so:dlopen
Just can't stay away
Just can't stay away


See User information
@Chris

Quote:

Is the .so definitely compiled with -fPIC and linked with -shared?


Yes, it is, and everything works fine if I link with libmp3lame.so directly. For some reason dlopen() won't open it though. I tried using dlerror() if it would say why it fails but it just returns a NULL pointer.

Quote:

Does the example in the archive work if you compile and run it?


Yes, it does.

Go to top
Re: libdl.so:dlopen
Amigans Defender
Amigans Defender


See User information
@salass00

libdl is just a wrapper round the elf.library functions. If it doesn't work, and the old OS4 libdl doesn't work, but directly linking does, then I don't really know what to suggest.

btw initdl just grabs all the necessary pointers from the executable. As it seems to be elf.library doing the crashing, it must be crashing trying to open the ELF Handle (probably because it is NULL).

I'll sort out a version tomorrow with some debugging info so we can figure out why - send me an email to remind me.

Chris

Go to top
Re: libdl.so:dlopen
Just can't stay away
Just can't stay away


See User information
@Chris

E-mail sent.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project