g++ -o helloworld helloworld.cc -Ofast -std=c++23 -s -flto -march=native -I../../include -static //ok no issue g++ -o helloworld helloworld.cc -Ofast -std=c++23 -s -flto -march=native -I../../include d:/x86_64-windows-gnu/x86_64-w64-mingw32/bin/../lib/gcc/x86_64-w64-mingw32/13.0.0/../../../../x86_64-w64-mingw32/bin/ld.exe: helloworld.exe:.rdata_r: section below image base Do not know whether it is an issue for mingw-w64 or libstdc++
This seems like a binutils ld bug rather than a libstdc++ bug ...
https://sourceware.org/pipermail/binutils-cvs/2021-March/056031.html
cygwin was improved here: https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=801120c1f402f9b0f72b5a231bf9e1cf82614cac It might be the case mingw linker script is broken ....
(In reply to Andrew Pinski from comment #3) > cygwin was improved here: > https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git; > h=801120c1f402f9b0f72b5a231bf9e1cf82614cac > > It might be the case mingw linker script is broken .... This is mingw-w64, not newlib-cygwin
(In reply to cqwrteur from comment #4) > (In reply to Andrew Pinski from comment #3) > > cygwin was improved here: > > https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git; > > h=801120c1f402f9b0f72b5a231bf9e1cf82614cac > > > > It might be the case mingw linker script is broken .... > > This is mingw-w64, not newlib-cygwin I think he's suggesting that we have to apply the same solution to mingw that Corinna applied to Cygwin.
(In reply to Andrew Pinski from comment #2) > https://sourceware.org/pipermail/binutils-cvs/2021-March/056031.html https://sourceware.org/bugzilla/show_bug.cgi?id=29973 I doubt this is the issue with ld linker. More likely to be a libstdc++ issue.