diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-10-31 00:11:28 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-31 18:30:56 -0400 |
commit | 52eb053b7191f1d3017a56e921753e3097876c47 (patch) | |
tree | 494c5212f096642d815f62472325235b5abecf35 | |
parent | d6898556e90ba9842e59ac9c2425b42ea33019b4 (diff) |
[SPARC64]: Fix linkage of enormous kernels.
This was found by make randconfig
If the kernel .text is very large, the .fixup section branches
are too far away to be relocated correctly.
Use "sethi %hi(label), reg; jmpl reg + %lo(label); %g0" sequence
instead of the branch to fix this.
There is another case in switch_to() involving a branch, which
is fixed similarly.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/asm-sparc64/futex.h | 6 | ||||
-rw-r--r-- | include/asm-sparc64/system.h | 4 | ||||
-rw-r--r-- | include/asm-sparc64/uaccess.h | 6 |
3 files changed, 11 insertions, 5 deletions
diff --git a/include/asm-sparc64/futex.h b/include/asm-sparc64/futex.h index 876312fe82..df1097d6ff 100644 --- a/include/asm-sparc64/futex.h +++ b/include/asm-sparc64/futex.h | |||
@@ -17,7 +17,8 @@ | |||
17 | "3:\n" \ | 17 | "3:\n" \ |
18 | " .section .fixup,#alloc,#execinstr\n" \ | 18 | " .section .fixup,#alloc,#execinstr\n" \ |
19 | " .align 4\n" \ | 19 | " .align 4\n" \ |
20 | "4: ba 3b\n" \ | 20 | "4: sethi %%hi(3b), %0\n" \ |
21 | " jmpl %0 + %%lo(3b), %%g0\n" \ | ||
21 | " mov %5, %0\n" \ | 22 | " mov %5, %0\n" \ |
22 | " .previous\n" \ | 23 | " .previous\n" \ |
23 | " .section __ex_table,\"a\"\n" \ | 24 | " .section __ex_table,\"a\"\n" \ |
@@ -91,7 +92,8 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | |||
91 | "2:\n" | 92 | "2:\n" |
92 | " .section .fixup,#alloc,#execinstr\n" | 93 | " .section .fixup,#alloc,#execinstr\n" |
93 | " .align 4\n" | 94 | " .align 4\n" |
94 | "3: ba 2b\n" | 95 | "3: sethi %%hi(2b), %0\n" |
96 | " jmpl %0 + %%lo(2b), %%g0\n" | ||
95 | " mov %4, %0\n" | 97 | " mov %4, %0\n" |
96 | " .previous\n" | 98 | " .previous\n" |
97 | " .section __ex_table,\"a\"\n" | 99 | " .section __ex_table,\"a\"\n" |
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index 159e62b51d..99a669c190 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h | |||
@@ -178,7 +178,9 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \ | |||
178 | "ldx [%%g6 + %9], %%g4\n\t" \ | 178 | "ldx [%%g6 + %9], %%g4\n\t" \ |
179 | "brz,pt %%o7, 1f\n\t" \ | 179 | "brz,pt %%o7, 1f\n\t" \ |
180 | " mov %%g7, %0\n\t" \ | 180 | " mov %%g7, %0\n\t" \ |
181 | "b,a ret_from_syscall\n\t" \ | 181 | "sethi %%hi(ret_from_syscall), %%g1\n\t" \ |
182 | "jmpl %%g1 + %%lo(ret_from_syscall), %%g0\n\t" \ | ||
183 | " nop\n\t" \ | ||
182 | "1:\n\t" \ | 184 | "1:\n\t" \ |
183 | : "=&r" (last), "=r" (current), "=r" (current_thread_info_reg), \ | 185 | : "=&r" (last), "=r" (current), "=r" (current_thread_info_reg), \ |
184 | "=r" (__local_per_cpu_offset) \ | 186 | "=r" (__local_per_cpu_offset) \ |
diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h index afe236ba55..93720e7b02 100644 --- a/include/asm-sparc64/uaccess.h +++ b/include/asm-sparc64/uaccess.h | |||
@@ -123,7 +123,8 @@ __asm__ __volatile__( \ | |||
123 | ".section .fixup,#alloc,#execinstr\n\t" \ | 123 | ".section .fixup,#alloc,#execinstr\n\t" \ |
124 | ".align 4\n" \ | 124 | ".align 4\n" \ |
125 | "3:\n\t" \ | 125 | "3:\n\t" \ |
126 | "b 2b\n\t" \ | 126 | "sethi %%hi(2b), %0\n\t" \ |
127 | "jmpl %0 + %%lo(2b), %%g0\n\t" \ | ||
127 | " mov %3, %0\n\n\t" \ | 128 | " mov %3, %0\n\n\t" \ |
128 | ".previous\n\t" \ | 129 | ".previous\n\t" \ |
129 | ".section __ex_table,\"a\"\n\t" \ | 130 | ".section __ex_table,\"a\"\n\t" \ |
@@ -165,8 +166,9 @@ __asm__ __volatile__( \ | |||
165 | ".section .fixup,#alloc,#execinstr\n\t" \ | 166 | ".section .fixup,#alloc,#execinstr\n\t" \ |
166 | ".align 4\n" \ | 167 | ".align 4\n" \ |
167 | "3:\n\t" \ | 168 | "3:\n\t" \ |
169 | "sethi %%hi(2b), %0\n\t" \ | ||
168 | "clr %1\n\t" \ | 170 | "clr %1\n\t" \ |
169 | "b 2b\n\t" \ | 171 | "jmpl %0 + %%lo(2b), %%g0\n\t" \ |
170 | " mov %3, %0\n\n\t" \ | 172 | " mov %3, %0\n\n\t" \ |
171 | ".previous\n\t" \ | 173 | ".previous\n\t" \ |
172 | ".section __ex_table,\"a\"\n\t" \ | 174 | ".section __ex_table,\"a\"\n\t" \ |