Problems adding a custom section to a Windows binary

2014-10-12 Thread Gintautas Miliauskas
This is slightly offtopic, but maybe some of the Windows folks know an
answer to this question. I've been working on #9686
https://ghc.haskell.org/trac/ghc/ticket/9686, but have been blocked by
Windows rejecting all my attempts to add a custom section to a binary
withthe error bash: ./c.exe: cannot execute binary file: Exec format
error.

I'm not sure if this is a gcc/binutils bug or not (the exact same commands
with the same tools work fine on Linux binaries). I have filed
http://sourceforge.net/p/mingw/bugs/2239 and
https://sourceware.org/bugzilla/show_bug.cgi?id=17466 to see what the
developers say, but have not gotten a response yet. Perhaps someone here
knows what's going on?

-- 
Gintautas Miliauskas
___
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs


Re: Problems adding a custom section to a Windows binary

2014-10-12 Thread Brandon Allbery
On Sun, Oct 12, 2014 at 6:28 PM, Gintautas Miliauskas 
gintautas.miliaus...@gmail.com wrote:

 I'm not sure if this is a gcc/binutils bug or not (the exact same commands
 with the same tools work fine on Linux binaries).


There are huge differences between Linux ELF and Windows PE32/PE64; it
would not be surprising if libbfd had bugs in the latter but not the
former. Beyond that, I don't know.

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net
___
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs


Re: Problems adding a custom section to a Windows binary

2014-10-12 Thread Edward Z. Yang
My suggestion is to have GHC spit some assembler that it is already
generating, and see if custom sections are used at any point.

Edward

Excerpts from Gintautas Miliauskas's message of 2014-10-12 15:28:40 -0700:
 This is slightly offtopic, but maybe some of the Windows folks know an
 answer to this question. I've been working on #9686
 https://ghc.haskell.org/trac/ghc/ticket/9686, but have been blocked by
 Windows rejecting all my attempts to add a custom section to a binary
 withthe error bash: ./c.exe: cannot execute binary file: Exec format
 error.
 
 I'm not sure if this is a gcc/binutils bug or not (the exact same commands
 with the same tools work fine on Linux binaries). I have filed
 http://sourceforge.net/p/mingw/bugs/2239 and
 https://sourceware.org/bugzilla/show_bug.cgi?id=17466 to see what the
 developers say, but have not gotten a response yet. Perhaps someone here
 knows what's going on?
 
___
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs