Symbols in built executables

Bryan O'Sullivan bos at
Tue Jun 17 19:16:14 EDT 2008

Here's something I just stumbled upon by accident: at least on Linux,
GHC emits huge numbers of symbols into the binaries it generates.
Here's Haddock, which I compiled without any funny debug options:

$ du -h haddock-0.9
4.1M   haddock-0.9
$ nm haddock-0.9 | wc -l
$ strip haddock-0.9
$ du -h haddock-0.9
2.7M haddock-0.9

I happened upon this because I'm repackaging GHC 6.8.3 for Fedora, and
rpmlint complained that haddock was not stripped. The RPM packager
automatically strips binaries using "strip -g", but that wasn't
stripping any of the abovementioned symbols.

I don't know what the purpose of those symbols might be. Could someone
fill me in, please? Can they actually be used for anything?

More information about the Glasgow-haskell-users mailing list