Handrolled linker?

Simon Marlow simonmar at microsoft.com
Mon Jun 14 12:03:20 EDT 2004


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


More information about the Glasgow-haskell-users mailing list