[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
dlopen() incompatible with Solaris version
From: |
Benedict Bridgwater |
Subject: |
dlopen() incompatible with Solaris version |
Date: |
Fri, 13 Oct 2000 01:03:35 -0400 |
On Solaris I can create a module that can be loaded with Sun's dlopen()
by simply doing:
gcc -c module.c
dlopen("./module.o", mode) will then work.
On Linux (Mandrake 7.1), if I try this dlopen() fails, and dlerror()
returns:
./module.o: ELF file's phentsize not the expected size
After a quick search, I found the solution was to do:
gcc -c module.d
ld -shared -o module.dll module.o
Then dlopen("./module.dll", mode) succeeds.
Afterwards, reading the Sun and GNU man pages, I see this is documented
(Sun's dlopen says it works on executable object files, GNU's says
dynamic libraries), but it seems bad to have copied Sun's API without
copying the semantics! IMO at minimum, the man page - which says
dlopen() was copied from Sun - should highlight the difference,
preferably the error reported should be changed to something more useful
such as "ELF file not a dynamic library", and ideally the semantic
difference would be fixed!
Ben
- dlopen() incompatible with Solaris version,
Benedict Bridgwater <=