title: Reduce size of executable produced by GHC
body: <p>Using GHC version 7.4.2 with flags like -O3, I still get huge executable produced. I understand that GHC does static linking, and dependencies of the binary looks like:</p>
  
  <pre><code>    linux-vdso.so.1 (0x00007fff49bff000)
      libpcre.so.1 =&gt; /usr/lib/libpcre.so.1 (0x00007fe658d6c000)
      librt.so.1 =&gt; /usr/lib/librt.so.1 (0x00007fe658b64000)
      libutil.so.1 =&gt; /usr/lib/libutil.so.1 (0x00007fe658961000)
      libdl.so.2 =&gt; /usr/lib/libdl.so.2 (0x00007fe65875d000)
      libpthread.so.0 =&gt; /usr/lib/libpthread.so.0 (0x00007fe658541000)
      libcurl.so.4 =&gt; /usr/lib/libcurl.so.4 (0x00007fe6582e3000)
      libgmp.so.10 =&gt; /usr/lib/libgmp.so.10 (0x00007fe658074000)
      libm.so.6 =&gt; /usr/lib/libm.so.6 (0x00007fe657d7a000)
      libgcc_s.so.1 =&gt; /usr/lib/libgcc_s.so.1 (0x00007fe657b65000)
      libc.so.6 =&gt; /usr/lib/libc.so.6 (0x00007fe6577be000)
      /lib/ld-linux-x86-64.so.2 (0x00007fe658fca000)
      libssh2.so.1 =&gt; /usr/lib/libssh2.so.1 (0x00007fe657595000)
      libssl.so.1.0.0 =&gt; /usr/lib/libssl.so.1.0.0 (0x00007fe65732b000)
      libcrypto.so.1.0.0 =&gt; /usr/lib/libcrypto.so.1.0.0 (0x00007fe656f22000)
      libz.so.1 =&gt; /usr/lib/libz.so.1 (0x00007fe656d0c000
  </code></pre>
  
  <p>so far it looks quite good, however inside the binary I can see the lines:</p>
  
  <pre><code>GHCi runtime linker: fatal error: I found a duplicate definition for symbol
  * Specifying the same object file twice on the GHCi command line 
  
    ....BlockedIndefinitelyOnMVar.......BlockedIndefinitelyOnSTM........AsyncException..base....GHC.IO.FD.......FD......GHC.IO.FD.setSize.
  </code></pre>
  
  <p>and actually a lot of text lines, including names of my functions, functions defined in other modules and so on. The question is - is it possible to remove those texts, and can GHC eliminate unused code from external libraries?</p>