[Haskell-cafe] Re: Windows details

Jonathan Cast jonathanccast at fastmail.fm
Fri Sep 12 13:17:39 EDT 2008


On Fri, 2008-09-12 at 18:07 +0100, Andrew Coppin wrote:
> Bulat Ziganshin wrote:
> > Hello Andrew,
> >
> > Thursday, September 11, 2008, 11:24:24 PM, you wrote:
> >
> >   
> >> interestingly, XN seems to make GHC-compiled binary files dramatically
> >> *smaller*... huh??)
> >>     
> >
> > probably it does `strip` on executable. -optl-s option does the same
> > trick
> >   
> 
> And what exactly does a "strip" mean, then?

Remove the symbol table.  And, for C, other debugging information.

Historically, I believe, on Unix the distinction between an executable
and an object file was weaker than it is now (so, for example, a.out was
originally the default name of an object file, back when you didn't
always need to link in a library).  So (and this is still sometimes true
on linux) the linker's output could be used as input to the linker.
Unix linkers still include the combined symbol table in the executables
they generate, to allow this.  But if your executable is complete, you
don't need a symbol table, so Unix includes a program `strip' that
removes it from an executable (or object file, if you do something
stupid).

GHC's Windows port, of course, uses a port of the Unix toolchain, so the
above discussion (almost) completely applies.  (Although I don't think
any (static) linker actually accepts Windows PE executables as input).

jcc




More information about the Haskell-Cafe mailing list