I recently found out that the instructions I wrote to compile HDBC-postgresql on Windows no longer work with Haskell Platform 2012.2.0.0. The library is building in order, but trying to link the built-in cabal library fails:
Loading package HDBC-postgresql-2.3.2.1 ... ghc.exe: Unknown PEi386 section name
`.idata $ 4 '(while processing: C: /PROGRA~1/POSTGR~1/9.2/lib \ libpq.a)
ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.4.1 for i386-unknown-mingw32):
loadArchive "C: /PROGRA~1/POSTGR~1/9.2/lib \\ libpq.a": failed
I tried libpq.a with dlltool --no-idata4 --no-idata5 , but then the error message changed to Unknown PEi386 section name `.idata$7' .
GGC 7103 seems to be bug .
In accordance with the PE and COFF specifications, the dollar sign has special meaning when included in section names, signaling a “grouped section”. The linker is supposed to discard "$" and all subsequent characters to create a merged .idata , where the characters following the "$" are used to determine the order in which the merged section is contributed.
Is there a way to force dlltool not to display grouped partitions?
As an alternative, is it possible to use the GNU archive (file A), merge all grouped partitions and display the resulting combined import library (implib)?
EDIT: The same thing happens with Haskell Platform 2012.4.0.0.
EDIT2 After looking at the dlltool source code , there seems to be no way to make it not display grouped sections. In addition, I did not find a ready-made utility that combines grouped sections in an object file.
For the sake of generosity, and this question, I change it to: How to build one .idata specified for a module definition file (DEF).