aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2012-08-08 21:25:35 -0400
committerChris Zankel <chris@zankel.net>2012-12-19 00:10:20 -0500
commitc0226e34a4293dee0e7c5787e1ebfc5ee8b44b7c (patch)
tree730149cbd56ebfdd916420e9c9d39ded7005ec4f /arch/xtensa
parent6550162200b40d1e725167f8a617255c42b57552 (diff)
xtensa: make DoubleExceptionVector literals fit the gap
Manually load references to exc_table from the explicit literal in order to fit DoubleExceptionVector.literals into the available 16-byte gap before DoubleExceptionVector.text in the absence of link time relaxation. Without this fix DoubleExceptionVector.literal section overlaps DoubleExceptionVector.text section in the linked vmlinux image. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/kernel/vectors.S14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/xtensa/kernel/vectors.S b/arch/xtensa/kernel/vectors.S
index 4462c1e595c2..3a57c15f7942 100644
--- a/arch/xtensa/kernel/vectors.S
+++ b/arch/xtensa/kernel/vectors.S
@@ -225,7 +225,13 @@ ENTRY(_DoubleExceptionVector)
225 /* Window overflow/underflow exception. Get stack pointer. */ 225 /* Window overflow/underflow exception. Get stack pointer. */
226 226
227 mov a3, a2 227 mov a3, a2
228 movi a2, exc_table 228 /* This explicit literal and the following references to it are made
229 * in order to fit DoubleExceptionVector.literals into the available
230 * 16-byte gap before DoubleExceptionVector.text in the absence of
231 * link time relaxation. See kernel/vmlinux.lds.S
232 */
233 .literal .Lexc_table, exc_table
234 l32r a2, .Lexc_table
229 l32i a2, a2, EXC_TABLE_KSTK 235 l32i a2, a2, EXC_TABLE_KSTK
230 236
231 /* Check for overflow/underflow exception, jump if overflow. */ 237 /* Check for overflow/underflow exception, jump if overflow. */
@@ -255,7 +261,7 @@ ENTRY(_DoubleExceptionVector)
255 s32i a0, a2, PT_AREG0 261 s32i a0, a2, PT_AREG0
256 262
257 wsr a3, excsave1 # save a3 263 wsr a3, excsave1 # save a3
258 movi a3, exc_table 264 l32r a3, .Lexc_table
259 265
260 rsr a0, exccause 266 rsr a0, exccause
261 s32i a0, a2, PT_DEPC # mark it as a regular exception 267 s32i a0, a2, PT_DEPC # mark it as a regular exception
@@ -267,7 +273,7 @@ ENTRY(_DoubleExceptionVector)
267 273
268 /* a0: depc, a1: a1, a2: a2, a3: trashed, depc: a0, excsave1: a3 */ 274 /* a0: depc, a1: a1, a2: a2, a3: trashed, depc: a0, excsave1: a3 */
269 275
270 movi a3, exc_table 276 l32r a3, .Lexc_table
271 s32i a2, a3, EXC_TABLE_DOUBLE_SAVE # temporary variable 277 s32i a2, a3, EXC_TABLE_DOUBLE_SAVE # temporary variable
272 278
273 /* Enter critical section. */ 279 /* Enter critical section. */
@@ -296,7 +302,7 @@ ENTRY(_DoubleExceptionVector)
296 302
297 /* a0: avail, a1: a1, a2: kstk, a3: avail, depc: a2, excsave: a3 */ 303 /* a0: avail, a1: a1, a2: kstk, a3: avail, depc: a2, excsave: a3 */
298 304
299 movi a3, exc_table 305 l32r a3, .Lexc_table
300 rsr a0, exccause 306 rsr a0, exccause
301 addx4 a0, a0, a3 307 addx4 a0, a0, a3
302 l32i a0, a0, EXC_TABLE_FAST_USER 308 l32i a0, a0, EXC_TABLE_FAST_USER