When configuring GCC for mips-linux-gnu, this happens:

configure:26145: checking assembler and linker for explicit JALR relocation
conftest.s: Assembler messages:
conftest.s:2: Internal error!
Assertion failure in macro_build at /scratch/sandra/mips-fsf/obj/binutils-src-mainline-0-mips-linux-gnu-i686-pc-linux-gnu/gas/config/tc-mips.c line 7953.
Please report this bug.

Probably this should be diagnosed as a user error instead of an assert failure on the binutils side, but on the GCC side, the assembly code being used for this configure test is incorrect and it would make the JALR relocation support test fail even if the assembler diagnosed it more nicely. The trouble is that for the o32 ABI (the assembler default), the "ld" instruction being used in the test is really a macro that expands into 2 instructions. This patch fixes it by substituting "lw", which allows the configure test to pass.

OK to commit?

-Sandra

2014-05-12  Catherine Moore  <c...@codesourcery.com>
            Sandra Loosemore  <san...@codesourcery.com>

        gcc/
        * configure.ac: Fix assembly for explicit JALR relocation check.
        * configure: Regenerate.
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 210340)
+++ gcc/configure.ac	(working copy)
@@ -4206,8 +4206,8 @@ x:
         fi
       elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x; then
         echo '	.ent x' > conftest.s
-        echo 'x:	ld $2,%got_disp(y)($3)' >> conftest.s
-        echo '	ld $25,%call16(y)($28)' >> conftest.s
+        echo 'x:	lw $2,%got_disp(y)($3)' >> conftest.s
+        echo '	lw $25,%call16(y)($28)' >> conftest.s
         echo '	.reloc	1f,R_MIPS_JALR,y' >> conftest.s
         echo '1:	jalr $25' >> conftest.s
         echo '	.reloc	1f,R_MIPS_JALR,x' >> conftest.s
Index: gcc/configure
===================================================================
--- gcc/configure	(revision 210340)
+++ gcc/configure	(working copy)
@@ -26153,8 +26153,8 @@ $as_echo_n "checking assembler and linke
         fi
       elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x; then
         echo '	.ent x' > conftest.s
-        echo 'x:	ld $2,%got_disp(y)($3)' >> conftest.s
-        echo '	ld $25,%call16(y)($28)' >> conftest.s
+        echo 'x:	lw $2,%got_disp(y)($3)' >> conftest.s
+        echo '	lw $25,%call16(y)($28)' >> conftest.s
         echo '	.reloc	1f,R_MIPS_JALR,y' >> conftest.s
         echo '1:	jalr $25' >> conftest.s
         echo '	.reloc	1f,R_MIPS_JALR,x' >> conftest.s

Reply via email to