Bug 26048 - -gsplit-dwarf leads to invalid PE file
Summary: -gsplit-dwarf leads to invalid PE file
Status: UNCONFIRMED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.30
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-26 18:35 UTC by trass3r
Modified: 2020-06-04 14:30 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
Project(s) to access:
ssh public key:


Attachments
test files (17.07 KB, application/x-zip-compressed)
2020-06-04 14:30 UTC, trass3r
Details

Note You need to log in before you can comment on or make changes to this bug.
Description trass3r 2020-05-26 18:35:06 UTC
int main() {}

g++ -c -O3 -gsplit-dwarf test.cpp
g++ test.o -o test

Produces an executable that can't be started ("This app can't run on your PC").
It looks like there's a problem with the SizeOfImage header entry and there are suspicious sections /4, /24 and /36 all mapped to address FFC00000.

Tested with MinGW 8.1 as distributed by Qt.
Comment 1 Nick Clifton 2020-06-04 13:37:23 UTC
(In reply to trass3r from comment #0)

Are you able to reproduce this problem with the latest version of the binutils ? Release 2.30 is quite old now.

Assuming that it is reproducible, please could you upload the "test.o" and "test" binaries from your example so that we can examine them.

Does the problem go away if the -gsplit-dwarf option is omitted ?
Comment 2 trass3r 2020-06-04 14:30:17 UTC
Created attachment 12587 [details]
test files

Also happens with ld 2.34 from http://winlibs.com/.
Works with just -g.