Home  
Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
40 user(s) are online (7 user(s) are browsing Forums)

Members: 0
Guests: 40

more...
Support us!
Recent OS4 Files
OS4Depot.net





libdl.so:dlopen
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1281
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.

   Report Go to top

Re: libdl.so:dlopen
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1281
@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).

   Report Go to top

Re: libdl.so:dlopen
Amigans Defender
Joined:
2006/11/17 22:40
From England
Posts: 2862
@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

   Report Go to top

Re: libdl.so:dlopen
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1281
@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.

   Report Go to top

Re: libdl.so:dlopen
Amigans Defender
Joined:
2006/11/17 22:40
From England
Posts: 2862
@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

   Report Go to top

Re: libdl.so:dlopen
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1281
@Chris

E-mail sent.

   Report Go to top





[Advanced Search]


Powered by XOOPS 2.0 © 2001-2014 The XOOPS Project