Skip to content

Commit 88987ef

Browse files
committed
Thumb-2: Add some .align statements to the .S files
Since the Thumb-2 instructions can be 16-bit wide, data in the .text sections may not be aligned to a 32-bit word and this leads to unaligned exceptions. This patch does not affect the ARM code generation. Signed-off-by: Catalin Marinas <[email protected]>
1 parent 4be3bd7 commit 88987ef

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

arch/arm/boot/compressed/head.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ wont_overwrite: mov r0, r4
291291
bl decompress_kernel
292292
b call_kernel
293293

294+
.align 2
294295
.type LC0, #object
295296
LC0: .word LC0 @ r1
296297
.word __bss_start @ r2
@@ -589,6 +590,7 @@ call_cache_fn: adr r12, proc_types
589590
* methods. Writeback caches _must_ have the flush method
590591
* defined.
591592
*/
593+
.align 2
592594
.type proc_types,#object
593595
proc_types:
594596
.word 0x41560600 @ ARM6/610
@@ -945,6 +947,7 @@ __armv3_mpu_cache_flush:
945947
* memory, which again must be relocatable.
946948
*/
947949
#ifdef DEBUG
950+
.align 2
948951
.type phexbuf,#object
949952
phexbuf: .space 12
950953
.size phexbuf, . - phexbuf

arch/arm/kernel/entry-armv.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,10 @@ vector_\name:
10651065
ldr lr, [pc, lr, lsl #2]
10661066
movs pc, lr @ branch to handler in SVC mode
10671067
ENDPROC(vector_\name)
1068+
1069+
.align 2
1070+
@ handler addresses follow this label
1071+
1:
10681072
.endm
10691073

10701074
.globl __stubs_start

arch/arm/kernel/head-common.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define ATAG_CORE 0x54410001
1515
#define ATAG_CORE_SIZE ((2*4 + 3*4) >> 2)
1616

17+
.align 2
1718
.type __switch_data, %object
1819
__switch_data:
1920
.long __mmap_switched
@@ -185,6 +186,7 @@ ENDPROC(lookup_processor_type)
185186
* Look in <asm/procinfo.h> and arch/arm/kernel/arch.[ch] for
186187
* more information about the __proc_info and __arch_info structures.
187188
*/
189+
.align 2
188190
.long __proc_info_begin
189191
.long __proc_info_end
190192
3: .long .

arch/arm/lib/sha1.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ ENTRY(sha_transform)
187187

188188
ENDPROC(sha_transform)
189189

190+
.align 2
190191
.L_sha_K:
191192
.word 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6
192193

@@ -195,6 +196,7 @@ ENDPROC(sha_transform)
195196
* void sha_init(__u32 *buf)
196197
*/
197198

199+
.align 2
198200
.L_sha_initial_digest:
199201
.word 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0
200202

arch/arm/vfp/entry.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ ENTRY(vfp_null_entry)
4242
mov pc, lr
4343
ENDPROC(vfp_null_entry)
4444

45+
.align 2
4546
.LCvfp:
4647
.word vfp_vector
4748

@@ -61,6 +62,7 @@ ENTRY(vfp_testing_entry)
6162
mov pc, r9 @ we have handled the fault
6263
ENDPROC(vfp_testing_entry)
6364

65+
.align 2
6466
VFP_arch_address:
6567
.word VFP_arch
6668

0 commit comments

Comments
 (0)