RFC: ghc's dynamic linker

Simon Marlow simonmar@microsoft.com
Wed, 28 Aug 2002 10:00:46 +0100

> From: Duncan Coutts [mailto:duncan@coutts.uklinux.net]=20
> Sent: 28 August 2002 00:51
> Would it be easier/better to exlicitly specify a symbol map=20
> file for the
> linker to use to locate the appropriate points in the current binary.
> Then perhaps we need a flag to ask ghc to spit out a symbol map along
> with the .o. Alternatively there tools to extract the map from a .o, I
> don't know - I'm not a bin-utils guru!

Possibly, but our linker already has most of the machinery necessary to
read the symbol table out of a binary (the binary format is largely the
same as an object file, it just has a fixed load address), so I'm
guessing that using a symbol map will be extra work.

> > Summary: extending GHC's dynamic linker to be able to slurp in the
> > symbol table from the currently running binary would be=20
> useful, and is a
> > good bite-sized GHC hacker task.  I can't guarantee that we'll get
> > around to it in a timely fashion, but contributions are, as always,
> > entirely welcome...
> Having made the suggestion, I'ts only right that I contribute=20
> my (limited)
> skills. I have done some gdb hacking before (not out of choice you
> understand!) so I ought to know a bit about .o's ELF sections=20
> and such.

Take a look in ghc/rts/Linker.c if you're interested.