Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Apply `.insn' to fixup labels throughout

Fix the issue with the ISA bit being lost in fixups that jump to labels
placed just before a section switch. Such a switch leads to the ISA bit
being lost, because GAS concludes there is no code that follows and
therefore the label refers to data. Use the `.insn' pseudo-op to
convince the tool this is not the case.

This lack of label annotation leads to microMIPS compilation errors
like:

mips-linux-gnu-ld: arch/mips/built-in.o: .fixup+0x3b8: Unsupported jump between ISA modes; consider recompiling with interlinking enabled.
mips-linux-gnu-ld: final link failed: Bad value

Signed-off-by: Maciej W. Rozycki <macro@codesourcery.com>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8483/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Maciej W. Rozycki and committed by
Ralf Baechle
0e525e48 b0984c43

+8
+4
arch/mips/include/asm/futex.h
··· 33 33 " beqzl $1, 1b \n" \ 34 34 __WEAK_LLSC_MB \ 35 35 "3: \n" \ 36 + " .insn \n" \ 36 37 " .set pop \n" \ 37 38 " .set mips0 \n" \ 38 39 " .section .fixup,\"ax\" \n" \ ··· 62 61 " beqz $1, 1b \n" \ 63 62 __WEAK_LLSC_MB \ 64 63 "3: \n" \ 64 + " .insn \n" \ 65 65 " .set pop \n" \ 66 66 " .set mips0 \n" \ 67 67 " .section .fixup,\"ax\" \n" \ ··· 164 162 " beqzl $1, 1b \n" 165 163 __WEAK_LLSC_MB 166 164 "3: \n" 165 + " .insn \n" 167 166 " .set pop \n" 168 167 " .section .fixup,\"ax\" \n" 169 168 "4: li %0, %6 \n" ··· 193 190 " beqz $1, 1b \n" 194 191 __WEAK_LLSC_MB 195 192 "3: \n" 193 + " .insn \n" 196 194 " .set pop \n" 197 195 " .section .fixup,\"ax\" \n" 198 196 "4: li %0, %6 \n"
+2
arch/mips/include/asm/paccess.h
··· 56 56 "1:\t" insn "\t%1,%2\n\t" \ 57 57 "move\t%0,$0\n" \ 58 58 "2:\n\t" \ 59 + ".insn\n\t" \ 59 60 ".section\t.fixup,\"ax\"\n" \ 60 61 "3:\tli\t%0,%3\n\t" \ 61 62 "move\t%1,$0\n\t" \ ··· 95 94 "1:\t" insn "\t%1,%2\n\t" \ 96 95 "move\t%0,$0\n" \ 97 96 "2:\n\t" \ 97 + ".insn\n\t" \ 98 98 ".section\t.fixup,\"ax\"\n" \ 99 99 "3:\tli\t%0,%3\n\t" \ 100 100 "j\t2b\n\t" \
+2
arch/mips/kernel/syscall.c
··· 117 117 "2: sc %[tmp], (%[addr]) \n" 118 118 " beqzl %[tmp], 1b \n" 119 119 "3: \n" 120 + " .insn \n" 120 121 " .section .fixup,\"ax\" \n" 121 122 "4: li %[err], %[efault] \n" 122 123 " j 3b \n" ··· 143 142 "2: sc %[tmp], (%[addr]) \n" 144 143 " bnez %[tmp], 4f \n" 145 144 "3: \n" 145 + " .insn \n" 146 146 " .subsection 2 \n" 147 147 "4: b 1b \n" 148 148 " .previous \n"