diff options
author | Maciej W. Rozycki <macro@codesourcery.com> | 2014-11-15 17:09:31 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-11-24 01:45:36 -0500 |
commit | 0e525e48f73cc8a4df8da0be77e4146bea85e1a5 (patch) | |
tree | 44d3ac8b6859b5b45ea9d58a71f7ac9f7a70336b /arch/mips | |
parent | b0984c43702f0fe2dbb0c344843e36c8b2cd13f1 (diff) |
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>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/include/asm/futex.h | 4 | ||||
-rw-r--r-- | arch/mips/include/asm/paccess.h | 2 | ||||
-rw-r--r-- | arch/mips/kernel/syscall.c | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/arch/mips/include/asm/futex.h b/arch/mips/include/asm/futex.h index d0177bf915bb..ef9987a61d88 100644 --- a/arch/mips/include/asm/futex.h +++ b/arch/mips/include/asm/futex.h | |||
@@ -33,6 +33,7 @@ | |||
33 | " beqzl $1, 1b \n" \ | 33 | " beqzl $1, 1b \n" \ |
34 | __WEAK_LLSC_MB \ | 34 | __WEAK_LLSC_MB \ |
35 | "3: \n" \ | 35 | "3: \n" \ |
36 | " .insn \n" \ | ||
36 | " .set pop \n" \ | 37 | " .set pop \n" \ |
37 | " .set mips0 \n" \ | 38 | " .set mips0 \n" \ |
38 | " .section .fixup,\"ax\" \n" \ | 39 | " .section .fixup,\"ax\" \n" \ |
@@ -61,6 +62,7 @@ | |||
61 | " beqz $1, 1b \n" \ | 62 | " beqz $1, 1b \n" \ |
62 | __WEAK_LLSC_MB \ | 63 | __WEAK_LLSC_MB \ |
63 | "3: \n" \ | 64 | "3: \n" \ |
65 | " .insn \n" \ | ||
64 | " .set pop \n" \ | 66 | " .set pop \n" \ |
65 | " .set mips0 \n" \ | 67 | " .set mips0 \n" \ |
66 | " .section .fixup,\"ax\" \n" \ | 68 | " .section .fixup,\"ax\" \n" \ |
@@ -162,6 +164,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, | |||
162 | " beqzl $1, 1b \n" | 164 | " beqzl $1, 1b \n" |
163 | __WEAK_LLSC_MB | 165 | __WEAK_LLSC_MB |
164 | "3: \n" | 166 | "3: \n" |
167 | " .insn \n" | ||
165 | " .set pop \n" | 168 | " .set pop \n" |
166 | " .section .fixup,\"ax\" \n" | 169 | " .section .fixup,\"ax\" \n" |
167 | "4: li %0, %6 \n" | 170 | "4: li %0, %6 \n" |
@@ -190,6 +193,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, | |||
190 | " beqz $1, 1b \n" | 193 | " beqz $1, 1b \n" |
191 | __WEAK_LLSC_MB | 194 | __WEAK_LLSC_MB |
192 | "3: \n" | 195 | "3: \n" |
196 | " .insn \n" | ||
193 | " .set pop \n" | 197 | " .set pop \n" |
194 | " .section .fixup,\"ax\" \n" | 198 | " .section .fixup,\"ax\" \n" |
195 | "4: li %0, %6 \n" | 199 | "4: li %0, %6 \n" |
diff --git a/arch/mips/include/asm/paccess.h b/arch/mips/include/asm/paccess.h index 2474fc5d1751..af81ab0da55f 100644 --- a/arch/mips/include/asm/paccess.h +++ b/arch/mips/include/asm/paccess.h | |||
@@ -56,6 +56,7 @@ struct __large_pstruct { unsigned long buf[100]; }; | |||
56 | "1:\t" insn "\t%1,%2\n\t" \ | 56 | "1:\t" insn "\t%1,%2\n\t" \ |
57 | "move\t%0,$0\n" \ | 57 | "move\t%0,$0\n" \ |
58 | "2:\n\t" \ | 58 | "2:\n\t" \ |
59 | ".insn\n\t" \ | ||
59 | ".section\t.fixup,\"ax\"\n" \ | 60 | ".section\t.fixup,\"ax\"\n" \ |
60 | "3:\tli\t%0,%3\n\t" \ | 61 | "3:\tli\t%0,%3\n\t" \ |
61 | "move\t%1,$0\n\t" \ | 62 | "move\t%1,$0\n\t" \ |
@@ -94,6 +95,7 @@ extern void __get_dbe_unknown(void); | |||
94 | "1:\t" insn "\t%1,%2\n\t" \ | 95 | "1:\t" insn "\t%1,%2\n\t" \ |
95 | "move\t%0,$0\n" \ | 96 | "move\t%0,$0\n" \ |
96 | "2:\n\t" \ | 97 | "2:\n\t" \ |
98 | ".insn\n\t" \ | ||
97 | ".section\t.fixup,\"ax\"\n" \ | 99 | ".section\t.fixup,\"ax\"\n" \ |
98 | "3:\tli\t%0,%3\n\t" \ | 100 | "3:\tli\t%0,%3\n\t" \ |
99 | "j\t2b\n\t" \ | 101 | "j\t2b\n\t" \ |
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 4a4f9dda5658..604b558809c4 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c | |||
@@ -117,6 +117,7 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new) | |||
117 | "2: sc %[tmp], (%[addr]) \n" | 117 | "2: sc %[tmp], (%[addr]) \n" |
118 | " beqzl %[tmp], 1b \n" | 118 | " beqzl %[tmp], 1b \n" |
119 | "3: \n" | 119 | "3: \n" |
120 | " .insn \n" | ||
120 | " .section .fixup,\"ax\" \n" | 121 | " .section .fixup,\"ax\" \n" |
121 | "4: li %[err], %[efault] \n" | 122 | "4: li %[err], %[efault] \n" |
122 | " j 3b \n" | 123 | " j 3b \n" |
@@ -142,6 +143,7 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new) | |||
142 | "2: sc %[tmp], (%[addr]) \n" | 143 | "2: sc %[tmp], (%[addr]) \n" |
143 | " bnez %[tmp], 4f \n" | 144 | " bnez %[tmp], 4f \n" |
144 | "3: \n" | 145 | "3: \n" |
146 | " .insn \n" | ||
145 | " .subsection 2 \n" | 147 | " .subsection 2 \n" |
146 | "4: b 1b \n" | 148 | "4: b 1b \n" |
147 | " .previous \n" | 149 | " .previous \n" |