diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2013-08-09 15:38:43 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2013-08-30 11:56:11 -0400 |
commit | d4d9eab4ade468b6a97b6853fdd72e8f21474324 (patch) | |
tree | cc7ebd45a2fb7f4abc1bde7d362c8f174016dfa2 /arch/tile/lib | |
parent | 3fa17c395bb0c358745fbe0c8aa039d6cdac1735 (diff) |
tile: use proper .align directives on __ex_table sections
This may fix a reported bug where an R_TILEGX_64 in a module was not
pointing to an aligned address.
Reported-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/lib')
-rw-r--r-- | arch/tile/lib/atomic_asm_32.S | 1 | ||||
-rw-r--r-- | arch/tile/lib/memcpy_32.S | 2 | ||||
-rw-r--r-- | arch/tile/lib/memcpy_user_64.c | 2 | ||||
-rw-r--r-- | arch/tile/lib/usercopy_32.S | 6 | ||||
-rw-r--r-- | arch/tile/lib/usercopy_64.S | 6 |
5 files changed, 17 insertions, 0 deletions
diff --git a/arch/tile/lib/atomic_asm_32.S b/arch/tile/lib/atomic_asm_32.S index 30638042691d..6bda3132cd61 100644 --- a/arch/tile/lib/atomic_asm_32.S +++ b/arch/tile/lib/atomic_asm_32.S | |||
@@ -164,6 +164,7 @@ STD_ENTRY_SECTION(__atomic\name, .text.atomic) | |||
164 | STD_ENDPROC(__atomic\name) | 164 | STD_ENDPROC(__atomic\name) |
165 | .ifc \bitwidth,32 | 165 | .ifc \bitwidth,32 |
166 | .pushsection __ex_table,"a" | 166 | .pushsection __ex_table,"a" |
167 | .align 4 | ||
167 | .word 1b, __atomic\name | 168 | .word 1b, __atomic\name |
168 | .word 2b, __atomic\name | 169 | .word 2b, __atomic\name |
169 | .word __atomic\name, __atomic_bad_address | 170 | .word __atomic\name, __atomic_bad_address |
diff --git a/arch/tile/lib/memcpy_32.S b/arch/tile/lib/memcpy_32.S index 2a419a6122db..8ba7626cfeb1 100644 --- a/arch/tile/lib/memcpy_32.S +++ b/arch/tile/lib/memcpy_32.S | |||
@@ -44,6 +44,7 @@ | |||
44 | */ | 44 | */ |
45 | #define EX \ | 45 | #define EX \ |
46 | .pushsection __ex_table, "a"; \ | 46 | .pushsection __ex_table, "a"; \ |
47 | .align 4; \ | ||
47 | .word 9f, memcpy_common_fixup; \ | 48 | .word 9f, memcpy_common_fixup; \ |
48 | .popsection; \ | 49 | .popsection; \ |
49 | 9 | 50 | 9 |
@@ -614,5 +615,6 @@ memcpy_fixup_loop: | |||
614 | .size memcpy_common_fixup, . - memcpy_common_fixup | 615 | .size memcpy_common_fixup, . - memcpy_common_fixup |
615 | 616 | ||
616 | .section __ex_table,"a" | 617 | .section __ex_table,"a" |
618 | .align 4 | ||
617 | .word .Lcfu, .Lcopy_from_user_fixup_zero_remainder | 619 | .word .Lcfu, .Lcopy_from_user_fixup_zero_remainder |
618 | .word .Lctu, .Lcopy_to_user_fixup_done | 620 | .word .Lctu, .Lcopy_to_user_fixup_done |
diff --git a/arch/tile/lib/memcpy_user_64.c b/arch/tile/lib/memcpy_user_64.c index 37440caa7370..88c7016492c4 100644 --- a/arch/tile/lib/memcpy_user_64.c +++ b/arch/tile/lib/memcpy_user_64.c | |||
@@ -31,6 +31,7 @@ | |||
31 | ".pushsection .coldtext.memcpy,\"ax\";" \ | 31 | ".pushsection .coldtext.memcpy,\"ax\";" \ |
32 | "2: { move r0, %2; jrp lr };" \ | 32 | "2: { move r0, %2; jrp lr };" \ |
33 | ".section __ex_table,\"a\";" \ | 33 | ".section __ex_table,\"a\";" \ |
34 | ".align 8;" \ | ||
34 | ".quad 1b, 2b;" \ | 35 | ".quad 1b, 2b;" \ |
35 | ".popsection" \ | 36 | ".popsection" \ |
36 | : "=m" (*(p)) : "r" (v), "r" (n)); \ | 37 | : "=m" (*(p)) : "r" (v), "r" (n)); \ |
@@ -43,6 +44,7 @@ | |||
43 | ".pushsection .coldtext.memcpy,\"ax\";" \ | 44 | ".pushsection .coldtext.memcpy,\"ax\";" \ |
44 | "2: { move r0, %2; jrp lr };" \ | 45 | "2: { move r0, %2; jrp lr };" \ |
45 | ".section __ex_table,\"a\";" \ | 46 | ".section __ex_table,\"a\";" \ |
47 | ".align 8;" \ | ||
46 | ".quad 1b, 2b;" \ | 48 | ".quad 1b, 2b;" \ |
47 | ".popsection" \ | 49 | ".popsection" \ |
48 | : "=r" (__v) : "m" (*(p)), "r" (n)); \ | 50 | : "=r" (__v) : "m" (*(p)), "r" (n)); \ |
diff --git a/arch/tile/lib/usercopy_32.S b/arch/tile/lib/usercopy_32.S index 21ffa88ffe5f..bb4c127be6e9 100644 --- a/arch/tile/lib/usercopy_32.S +++ b/arch/tile/lib/usercopy_32.S | |||
@@ -36,6 +36,7 @@ strnlen_user_fault: | |||
36 | { move r0, zero; jrp lr } | 36 | { move r0, zero; jrp lr } |
37 | ENDPROC(strnlen_user_fault) | 37 | ENDPROC(strnlen_user_fault) |
38 | .section __ex_table,"a" | 38 | .section __ex_table,"a" |
39 | .align 4 | ||
39 | .word 1b, strnlen_user_fault | 40 | .word 1b, strnlen_user_fault |
40 | .popsection | 41 | .popsection |
41 | 42 | ||
@@ -59,6 +60,7 @@ strncpy_from_user_fault: | |||
59 | { movei r0, -EFAULT; jrp lr } | 60 | { movei r0, -EFAULT; jrp lr } |
60 | ENDPROC(strncpy_from_user_fault) | 61 | ENDPROC(strncpy_from_user_fault) |
61 | .section __ex_table,"a" | 62 | .section __ex_table,"a" |
63 | .align 4 | ||
62 | .word 1b, strncpy_from_user_fault | 64 | .word 1b, strncpy_from_user_fault |
63 | .popsection | 65 | .popsection |
64 | 66 | ||
@@ -77,6 +79,7 @@ STD_ENTRY(clear_user_asm) | |||
77 | bnzt r1, 1b | 79 | bnzt r1, 1b |
78 | 2: { move r0, r1; jrp lr } | 80 | 2: { move r0, r1; jrp lr } |
79 | .pushsection __ex_table,"a" | 81 | .pushsection __ex_table,"a" |
82 | .align 4 | ||
80 | .word 1b, 2b | 83 | .word 1b, 2b |
81 | .popsection | 84 | .popsection |
82 | 85 | ||
@@ -86,6 +89,7 @@ STD_ENTRY(clear_user_asm) | |||
86 | 2: { move r0, r1; jrp lr } | 89 | 2: { move r0, r1; jrp lr } |
87 | STD_ENDPROC(clear_user_asm) | 90 | STD_ENDPROC(clear_user_asm) |
88 | .pushsection __ex_table,"a" | 91 | .pushsection __ex_table,"a" |
92 | .align 4 | ||
89 | .word 1b, 2b | 93 | .word 1b, 2b |
90 | .popsection | 94 | .popsection |
91 | 95 | ||
@@ -105,6 +109,7 @@ STD_ENTRY(flush_user_asm) | |||
105 | 2: { move r0, r1; jrp lr } | 109 | 2: { move r0, r1; jrp lr } |
106 | STD_ENDPROC(flush_user_asm) | 110 | STD_ENDPROC(flush_user_asm) |
107 | .pushsection __ex_table,"a" | 111 | .pushsection __ex_table,"a" |
112 | .align 4 | ||
108 | .word 1b, 2b | 113 | .word 1b, 2b |
109 | .popsection | 114 | .popsection |
110 | 115 | ||
@@ -124,5 +129,6 @@ STD_ENTRY(finv_user_asm) | |||
124 | 2: { move r0, r1; jrp lr } | 129 | 2: { move r0, r1; jrp lr } |
125 | STD_ENDPROC(finv_user_asm) | 130 | STD_ENDPROC(finv_user_asm) |
126 | .pushsection __ex_table,"a" | 131 | .pushsection __ex_table,"a" |
132 | .align 4 | ||
127 | .word 1b, 2b | 133 | .word 1b, 2b |
128 | .popsection | 134 | .popsection |
diff --git a/arch/tile/lib/usercopy_64.S b/arch/tile/lib/usercopy_64.S index f248d3196e5c..0d94844eb218 100644 --- a/arch/tile/lib/usercopy_64.S +++ b/arch/tile/lib/usercopy_64.S | |||
@@ -36,6 +36,7 @@ strnlen_user_fault: | |||
36 | { move r0, zero; jrp lr } | 36 | { move r0, zero; jrp lr } |
37 | ENDPROC(strnlen_user_fault) | 37 | ENDPROC(strnlen_user_fault) |
38 | .section __ex_table,"a" | 38 | .section __ex_table,"a" |
39 | .align 8 | ||
39 | .quad 1b, strnlen_user_fault | 40 | .quad 1b, strnlen_user_fault |
40 | .popsection | 41 | .popsection |
41 | 42 | ||
@@ -59,6 +60,7 @@ strncpy_from_user_fault: | |||
59 | { movei r0, -EFAULT; jrp lr } | 60 | { movei r0, -EFAULT; jrp lr } |
60 | ENDPROC(strncpy_from_user_fault) | 61 | ENDPROC(strncpy_from_user_fault) |
61 | .section __ex_table,"a" | 62 | .section __ex_table,"a" |
63 | .align 8 | ||
62 | .quad 1b, strncpy_from_user_fault | 64 | .quad 1b, strncpy_from_user_fault |
63 | .popsection | 65 | .popsection |
64 | 66 | ||
@@ -77,6 +79,7 @@ STD_ENTRY(clear_user_asm) | |||
77 | bnezt r1, 1b | 79 | bnezt r1, 1b |
78 | 2: { move r0, r1; jrp lr } | 80 | 2: { move r0, r1; jrp lr } |
79 | .pushsection __ex_table,"a" | 81 | .pushsection __ex_table,"a" |
82 | .align 8 | ||
80 | .quad 1b, 2b | 83 | .quad 1b, 2b |
81 | .popsection | 84 | .popsection |
82 | 85 | ||
@@ -86,6 +89,7 @@ STD_ENTRY(clear_user_asm) | |||
86 | 2: { move r0, r1; jrp lr } | 89 | 2: { move r0, r1; jrp lr } |
87 | STD_ENDPROC(clear_user_asm) | 90 | STD_ENDPROC(clear_user_asm) |
88 | .pushsection __ex_table,"a" | 91 | .pushsection __ex_table,"a" |
92 | .align 8 | ||
89 | .quad 1b, 2b | 93 | .quad 1b, 2b |
90 | .popsection | 94 | .popsection |
91 | 95 | ||
@@ -105,6 +109,7 @@ STD_ENTRY(flush_user_asm) | |||
105 | 2: { move r0, r1; jrp lr } | 109 | 2: { move r0, r1; jrp lr } |
106 | STD_ENDPROC(flush_user_asm) | 110 | STD_ENDPROC(flush_user_asm) |
107 | .pushsection __ex_table,"a" | 111 | .pushsection __ex_table,"a" |
112 | .align 8 | ||
108 | .quad 1b, 2b | 113 | .quad 1b, 2b |
109 | .popsection | 114 | .popsection |
110 | 115 | ||
@@ -124,5 +129,6 @@ STD_ENTRY(finv_user_asm) | |||
124 | 2: { move r0, r1; jrp lr } | 129 | 2: { move r0, r1; jrp lr } |
125 | STD_ENDPROC(finv_user_asm) | 130 | STD_ENDPROC(finv_user_asm) |
126 | .pushsection __ex_table,"a" | 131 | .pushsection __ex_table,"a" |
132 | .align 8 | ||
127 | .quad 1b, 2b | 133 | .quad 1b, 2b |
128 | .popsection | 134 | .popsection |