#39146: mingw linker creates invalid PE files Open Date: 2019-04-20 09:00 Last Update: 2019-05-21 06:48 URL for this Ticket: https://osdn.net//projects/mingw/ticket/39146 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39146 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2019-05-21 06:48 Updated by: brucedawson Comment: I'm not sure why you took offense at the bug report. I was just trying to point out a problem that I had noticed, that's all. there is no evidence that our tools play any part in its creation This is a crucial question, I agree. I am verifying whether git.exe is built using the mingw toolchain. I thought that it was but I cannot find confirmation at the moment. The Windows loader successfully runs git.exe, which is nice, but that doesn't mean that it is a valid PE file, it just means that WIndows can find enough correct information to load it. dumpbin looks at different fields and reports that some of these are wrong. In a comment from Microsoft on the bug (since deleted, so I put it back up) they said: "The executable contains invalid values in PE file header. As shown below, the "file pointer to symbol table" is 0x62200, while the file size is only 40,728 bytes. 62200 file pointer to symbol table 7C2 number of symbols The PE seems fine if we ignore those two fields." So, Microsoft has told us *exactly* which fields are wrong, and what is wrong with them. They will be fixing dumpbin to handle these incorrect PE files, but they are still incorrect. If they are produced by the mingw linker TL;DR - the git.exe binary has at least one invalid field, the "file pointer to symbol table". If git.exe is produced by the mingw linker then this bug is valid. If not, then not. I'll update this bug when I know more. --------------------------------------------------------------------- Ticket Status: Reporter: brucedawson Owner: (None) Type: Issues Status: Closed Priority: 5 - Medium MileStone: (None) Component: (None) Severity: 5 - Medium Resolution: Won't Fix --------------------------------------------------------------------- Ticket details: When using git.exe on Windows as part of the Chromium project I tried to obtain details about the debug information (PDB files) associated with git.exe by using Visual Studio's dumpbin. This failed due to invalid fields in the git.exe PE file. Details can be found in this Visual Studio bug: https://developercommunity.visualstudio.com/content/problem/386596/ dumpbin-fails-on-gitexe-for-windows.html Although Microsoft may update dumpbin to work around this bug in the git.exe binary as created by mingw it would be preferable if mingw would stop creating invalid PE files. I obtained git.exe from https://github.com/git-for-windows/git/tree/ v2.19.1.windows.1 -- Ticket information of MinGW - Minimalist GNU for Windows project MinGW - Minimalist GNU for Windows Project is hosted on OSDN Project URL: https://osdn.net/projects/mingw/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/mingw/ticket/39146 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39146