Browse Source

avr32: fix out-of-range rjmp instruction on large kernels

Use .subsection to place fixups closer to their jump targets. This
increases the maximum size of the kernel before we get link errors
significantly.

The problem here is that we don't have a "call"-ish pseudo-instruction
to use instead of rjmp...we could add one, but that means we'll have to
wait for a new toolchain release, wait until we're fairly sure most
people are using it, etc...

As an added bonus, it should decrease the RAM footprint slightly,
though it might pollute the icache a bit more.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Haavard Skinnemoen 16 years ago
parent
commit
61f3632fdc
1 changed files with 4 additions and 4 deletions
  1. 4 4
      arch/avr32/include/asm/uaccess.h

+ 4 - 4
arch/avr32/include/asm/uaccess.h

@@ -230,10 +230,10 @@ extern int __put_user_bad(void);
 	asm volatile(							\
 	asm volatile(							\
 		"1:	ld." suffix "	%1, %3			\n"	\
 		"1:	ld." suffix "	%1, %3			\n"	\
 		"2:						\n"	\
 		"2:						\n"	\
-		"	.section .fixup, \"ax\"			\n"	\
+		"	.subsection 1				\n"	\
 		"3:	mov	%0, %4				\n"	\
 		"3:	mov	%0, %4				\n"	\
 		"	rjmp	2b				\n"	\
 		"	rjmp	2b				\n"	\
-		"	.previous				\n"	\
+		"	.subsection 0				\n"	\
 		"	.section __ex_table, \"a\"		\n"	\
 		"	.section __ex_table, \"a\"		\n"	\
 		"	.long	1b, 3b				\n"	\
 		"	.long	1b, 3b				\n"	\
 		"	.previous				\n"	\
 		"	.previous				\n"	\
@@ -295,10 +295,10 @@ extern int __put_user_bad(void);
 	asm volatile(							\
 	asm volatile(							\
 		"1:	st." suffix "	%1, %3			\n"	\
 		"1:	st." suffix "	%1, %3			\n"	\
 		"2:						\n"	\
 		"2:						\n"	\
-		"	.section .fixup, \"ax\"			\n"	\
+		"	.subsection 1				\n"	\
 		"3:	mov	%0, %4				\n"	\
 		"3:	mov	%0, %4				\n"	\
 		"	rjmp	2b				\n"	\
 		"	rjmp	2b				\n"	\
-		"	.previous				\n"	\
+		"	.subsection 0				\n"	\
 		"	.section __ex_table, \"a\"		\n"	\
 		"	.section __ex_table, \"a\"		\n"	\
 		"	.long	1b, 3b				\n"	\
 		"	.long	1b, 3b				\n"	\
 		"	.previous				\n"	\
 		"	.previous				\n"	\