https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88422
--- Comment #5 from Nidal Faour <nidal.faour at wdc dot com> --- i've used the RV gcc official toolchain and reverted the patch as Jim did. and it passed in the test case, but when i moved to a bigger code, i failed again to build. and it turned out that it passed only if i drop the -g option from the compiling command. when using the -g option it will get the "file not recognized: file format not recognized" again. i've downloaded the RV toolchain from: https://github.com/riscv/riscv-gnu-toolchain configuration for linux building: ./configure --with-arch=rv64imafdc --with-abi=lp64d --enable-multilib --prefix=<Path-to-build-output> configuration for windows building: ./configure --with-arch=rv64imafdc --with-abi=lp64d --enable-multilib --without-system-zlib --with-cmodel=medany --with-host=x86_64-w64-mingw32 --prefix=<Path-to-win-build> test case can be found at: https://github.com/westerndigitalcorporation/riscv32-Code-density-test-bench/tree/master/lto_test_case