gcc: Use ld -r when checking for HAVE_LD_RO_RW_SECTION_MIXING
commit2744dbb9ecf104a113da3a0f39115da4653bb676
authorJoakim Nohlgård <joakim@nohlgard.se>
Sun, 30 Apr 2023 16:34:26 +0000 (30 10:34 -0600)
committerJeff Law <jlaw@ventanamicro>
Sun, 30 Apr 2023 16:34:26 +0000 (30 10:34 -0600)
tree61d8f4c6f9ca840e206733ddd0d105e865cc2a0f
parentd2ab430a16caa62a4cd71490e1a8759a1dd09c8e
gcc: Use ld -r when checking for HAVE_LD_RO_RW_SECTION_MIXING

Fall back to ld -r if ld -shared fails during configure. The check for
HAVE_LD_RO_RW_SECTION_MIXING can fail on targets where ld does not
support shared objects, even though the answer to the test should be
'read-write'. One such target is riscv64-unknown-elf. Failing this test
results in a libgcc crtbegin.o which has a writable .eh_frame section
leading to the default linker scripts placing the .eh_frame section in a
writable memory segment, or a linker warning when using ld scripts that
place .eh_frame unconditionally in ROM.

gcc/ChangeLog:

* configure: Regenerate.
* configure.ac: Use ld -r in the check for HAVE_LD_RO_RW_SECTION_MIXING
gcc/configure
gcc/configure.ac