summaryrefslogtreecommitdiffstats
path: root/arch/arc/kernel/unaligned.c
diff options
context:
space:
mode:
authorYuriy Kolerov <yuriy.kolerov@synopsys.com>2015-08-12 17:23:32 +0300
committerVineet Gupta <vgupta@synopsys.com>2015-08-20 18:53:15 +0530
commit6de6066c0d24a66df465cf87a4041ef7ef35ba6f (patch)
treef04687c44c4d3e537fcd83e287c9132d8737ef1e /arch/arc/kernel/unaligned.c
parenteb2cd8b72b08fe56998600aee8a5dff93f7be5a2 (diff)
downloadlinux-6de6066c0d24a66df465cf87a4041ef7ef35ba6f.tar.gz
linux-6de6066c0d24a66df465cf87a4041ef7ef35ba6f.tar.bz2
linux-6de6066c0d24a66df465cf87a4041ef7ef35ba6f.zip
ARC: change some branchs to jumps to resolve linkage errors
When kernel's binary becomes large enough (32M and more) errors may occur during the final linkage stage. It happens because the build system uses short relocations for ARC by default. This problem may be easily resolved by passing -mlong-calls option to GCC to use long absolute jumps (j) instead of short relative branchs (b). But there are fragments of pure assembler code exist which use branchs in inappropriate places and cause a linkage error because of relocations overflow. First of these fragments is .fixup insertion in futex.h and unaligned.c. It inserts a code in the separate section (.fixup) with branch instruction. It leads to the linkage error when kernel becomes large. Second of these fragments is calling scheduler's functions (common kernel code) from entry.S of ARC's code. When kernel's binary becomes large it may lead to the linkage error because scheduler may occur far enough from ARC's code in the final binary. Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/kernel/unaligned.c')
-rw-r--r--arch/arc/kernel/unaligned.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c
index 74db59b6f392..abd961f3e763 100644
--- a/arch/arc/kernel/unaligned.c
+++ b/arch/arc/kernel/unaligned.c
@@ -34,7 +34,7 @@
" .section .fixup,\"ax\"\n" \
" .align 4\n" \
"3: mov %0, 1\n" \
- " b 2b\n" \
+ " j 2b\n" \
" .previous\n" \
" .section __ex_table,\"a\"\n" \
" .align 4\n" \
@@ -82,7 +82,7 @@
" .section .fixup,\"ax\"\n" \
" .align 4\n" \
"4: mov %0, 1\n" \
- " b 3b\n" \
+ " j 3b\n" \
" .previous\n" \
" .section __ex_table,\"a\"\n" \
" .align 4\n" \
@@ -113,7 +113,7 @@
" .section .fixup,\"ax\"\n" \
" .align 4\n" \
"6: mov %0, 1\n" \
- " b 5b\n" \
+ " j 5b\n" \
" .previous\n" \
" .section __ex_table,\"a\"\n" \
" .align 4\n" \