Mercurial > hg > aboriginal
annotate sources/patches/linux-sparc.patch @ 1473:a584fb153593
Fix sparc kernel's relocation code.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 18 Dec 2011 13:34:35 -0600 |
parents | |
children |
rev | line source |
---|---|
1473
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 Subject: Re: Sparc-32 doesn't work in 3.1. |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 From: David Miller <davem@davemloft.net> |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 Date: Wed, 14 Dec 2011 12:54:43 -0500 (EST) |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 > The right fix is to simply teach btfixup to be able to patch |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 > the 'restore' just as equally as it would patch an 'or'. |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 Try this: |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
10 -------------------- |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
11 sparc32: Be less strict in matching %lo part of relocation. |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
12 |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
13 The "(insn & 0x01800000) != 0x01800000" test matches 'restore' |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
14 but that is a legitimate place to see the %lo() part of a 32-bit |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
15 symbol relocation, particularly in tail calls. |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
16 |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
17 Signed-off-by: David S. Miller <davem@davemloft.net> |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
18 --- |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 arch/sparc/mm/btfixup.c | 3 +-- |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
20 1 files changed, 1 insertions(+), 2 deletions(-) |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
22 diff --git a/arch/sparc/mm/btfixup.c b/arch/sparc/mm/btfixup.c |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
23 index 5175ac2..8a7f817 100644 |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
24 --- a/arch/sparc/mm/btfixup.c |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
25 +++ b/arch/sparc/mm/btfixup.c |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
26 @@ -302,8 +302,7 @@ void __init btfixup(void) |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
27 case 'i': /* INT */ |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
28 if ((insn & 0xc1c00000) == 0x01000000) /* %HI */ |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
29 set_addr(addr, q[1], fmangled, (insn & 0xffc00000) | (p[1] >> 10)); |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
30 - else if ((insn & 0x80002000) == 0x80002000 && |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
31 - (insn & 0x01800000) != 0x01800000) /* %LO */ |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
32 + else if ((insn & 0x80002000) == 0x80002000) /* %LO */ |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
33 set_addr(addr, q[1], fmangled, (insn & 0xffffe000) | (p[1] & 0x3ff)); |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
34 else { |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
35 prom_printf(insn_i, p, addr, insn); |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
36 -- |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
37 1.7.6.401.g6a319 |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
38 |
a584fb153593
Fix sparc kernel's relocation code.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
39 |