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.
(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 ?
Created attachment 12587 [details] test files Also happens with ld 2.34 from http://winlibs.com/. Works with just -g.