
On 02 June 2004 18:41, David Brown wrote:
On Wed, Jun 02, 2004 at 06:19:00PM +0100, Duncan Coutts wrote:
On Wed, 2004-06-02 at 17:44, David Brown wrote:
Any estimates on the difficulty of changing Linker.c to be able to use standard dynamic link calls (dlopen, ...) rather than having to be customized for every target platform.
I asked Simon M about this recently:
http://www.mail-archive.com/glasgow-haskell-users@haskell.org/msg06189.h tml
Actually, this isn't the question that I have. This is about ghci's dynamic loading of C objects (or other similar language). There is a handrolled linker in the ghci code. I'm interested in replacing this handrolled linker with dlopen... so that it is easier to port.
This might work... if the dynamic linker supports doing "ordinary" static-style linking. I've been meaning to try this on Linux. Note that we can't produce proper shared libraries (with position-independent code etc.), but we can produce libraries with relocation info that the dynamic linker can understand. The linker will scribble all over the library at load time, but that's not a problem (our existing linker does that anyway). Cheers, Simon

On Mon, Jun 14, 2004 at 05:03:20PM +0100, Simon Marlow wrote:
Actually, this isn't the question that I have. This is about ghci's dynamic loading of C objects (or other similar language). There is a handrolled linker in the ghci code. I'm interested in replacing this handrolled linker with dlopen... so that it is easier to port.
This might work... if the dynamic linker supports doing "ordinary" static-style linking. I've been meaning to try this on Linux.
dlopen will load pretty much any elf object file. There is little special about shared libraries in Linux. The position-independent code only localizes the changes that need to be made on link, so that more pages can be shared. Libraries work just fine without it. But, as someone pointed out, some of these files contain haskell code, and I'll have to look more into whether or not that will work. Dave
participants (2)
-
David Brown
-
Simon Marlow