Commit 1abd3502 authored by Russell King's avatar Russell King

ARM: align .data section

Robert Jarzmik reports that his PXA25x system fails to boot with 4.12,
failing at __flush_whole_cache in arch/arm/mm/proc-xscale.S:215:

   0xc0019e20 <+0>:     ldr     r1, [pc, #788]
   0xc0019e24 <+4>:     ldr     r0, [r1]	<== here

with r1 containing 0xc06f82cd, which is the address of "clean_addr".
Examination of the System.map shows:

c06f22c8 D user_pmd_table
c06f22cc d __warned.19178
c06f22cd d clean_addr

indicating that a .data.unlikely section has appeared just before the
.data section from proc-xscale.S.  According to objdump -h, it appears
that our assembly files default their .data alignment to 2**0, which
is bad news if the preceding .data section size is not power-of-2
aligned at link time.

Add the appropriate .align directives to all assembly files in arch/arm
that are missing them where we require an appropriate alignment.
Reported-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Tested-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent ce184a0d
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
#define UART_OFFSET(addr) ((addr) & 0x00ffffff) #define UART_OFFSET(addr) ((addr) & 0x00ffffff)
.pushsection .data .pushsection .data
.align 2
omap_uart_phys: .word 0 omap_uart_phys: .word 0
omap_uart_virt: .word 0 omap_uart_virt: .word 0
omap_uart_lsr: .word 0 omap_uart_lsr: .word 0
......
...@@ -721,6 +721,7 @@ do_fpe: ...@@ -721,6 +721,7 @@ do_fpe:
*/ */
.pushsection .data .pushsection .data
.align 2
ENTRY(fp_enter) ENTRY(fp_enter)
.word no_fp .word no_fp
.popsection .popsection
...@@ -1221,6 +1222,7 @@ vector_addrexcptn: ...@@ -1221,6 +1222,7 @@ vector_addrexcptn:
W(b) vector_fiq W(b) vector_fiq
.data .data
.align 2
.globl cr_alignment .globl cr_alignment
cr_alignment: cr_alignment:
......
...@@ -556,6 +556,7 @@ ENDPROC(__fixup_smp) ...@@ -556,6 +556,7 @@ ENDPROC(__fixup_smp)
.word __smpalt_end .word __smpalt_end
.pushsection .data .pushsection .data
.align 2
.globl smp_on_up .globl smp_on_up
smp_on_up: smp_on_up:
ALT_SMP(.long 1) ALT_SMP(.long 1)
...@@ -716,6 +717,7 @@ ENTRY(fixup_pv_table) ...@@ -716,6 +717,7 @@ ENTRY(fixup_pv_table)
ENDPROC(fixup_pv_table) ENDPROC(fixup_pv_table)
.data .data
.align 2
.globl __pv_phys_pfn_offset .globl __pv_phys_pfn_offset
.type __pv_phys_pfn_offset, %object .type __pv_phys_pfn_offset, %object
__pv_phys_pfn_offset: __pv_phys_pfn_offset:
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
* zeroing of .bss would clobber it. * zeroing of .bss would clobber it.
*/ */
.data .data
.align 2
ENTRY(__boot_cpu_mode) ENTRY(__boot_cpu_mode)
.long 0 .long 0
.text .text
......
...@@ -367,6 +367,7 @@ ENTRY(iwmmxt_task_release) ...@@ -367,6 +367,7 @@ ENTRY(iwmmxt_task_release)
ENDPROC(iwmmxt_task_release) ENDPROC(iwmmxt_task_release)
.data .data
.align 2
concan_owner: concan_owner:
.word 0 .word 0
...@@ -171,6 +171,7 @@ mpidr_hash_ptr: ...@@ -171,6 +171,7 @@ mpidr_hash_ptr:
.long mpidr_hash - . @ mpidr_hash struct offset .long mpidr_hash - . @ mpidr_hash struct offset
.data .data
.align 2
.type sleep_save_sp, #object .type sleep_save_sp, #object
ENTRY(sleep_save_sp) ENTRY(sleep_save_sp)
.space SLEEP_SAVE_SP_SZ @ struct sleep_save_sp .space SLEEP_SAVE_SP_SZ @ struct sleep_save_sp
...@@ -124,6 +124,7 @@ _cp15_save_diag: ...@@ -124,6 +124,7 @@ _cp15_save_diag:
#endif /* CONFIG_CACHE_L2X0 */ #endif /* CONFIG_CACHE_L2X0 */
.data .data
.align 2
.globl cp15_save_diag .globl cp15_save_diag
cp15_save_diag: cp15_save_diag:
.long 0 @ cp15 diagnostic .long 0 @ cp15 diagnostic
......
...@@ -530,10 +530,12 @@ l2dis_3630_offset: ...@@ -530,10 +530,12 @@ l2dis_3630_offset:
.long l2dis_3630 - . .long l2dis_3630 - .
.data .data
.align 2
l2dis_3630: l2dis_3630:
.word 0 .word 0
.data .data
.align 2
l2_inv_api_params: l2_inv_api_params:
.word 0x1, 0x00 .word 0x1, 0x00
......
...@@ -385,6 +385,7 @@ ppa_zero_params_offset: ...@@ -385,6 +385,7 @@ ppa_zero_params_offset:
ENDPROC(omap_do_wfi) ENDPROC(omap_do_wfi)
.data .data
.align 2
ppa_zero_params: ppa_zero_params:
.word 0 .word 0
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
* insist on it to be truly read-only. * insist on it to be truly read-only.
*/ */
.data .data
.align 2
ENTRY(mioa701_bootstrap) ENTRY(mioa701_bootstrap)
0: 0:
b 1f b 1f
...@@ -34,4 +35,5 @@ ENTRY(mioa701_jumpaddr) ...@@ -34,4 +35,5 @@ ENTRY(mioa701_jumpaddr)
ENTRY(mioa701_bootstrap_lg) ENTRY(mioa701_bootstrap_lg)
.data .data
.align 2
.word 2b-0b .word 2b-0b
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* ddr to sram for system resumeing. * ddr to sram for system resumeing.
* so it is ".data section". * so it is ".data section".
*/ */
.align .align 2
ENTRY(rockchip_slp_cpu_resume) ENTRY(rockchip_slp_cpu_resume)
setmode PSR_I_BIT | PSR_F_BIT | SVC_MODE, r1 @ set svc, irqs off setmode PSR_I_BIT | PSR_F_BIT | SVC_MODE, r1 @ set svc, irqs off
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#define CACHE_DLIMIT (CACHE_DSIZE * 4) #define CACHE_DLIMIT (CACHE_DSIZE * 4)
.data .data
.align 2
flush_base: flush_base:
.long FLUSH_BASE .long FLUSH_BASE
.text .text
......
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
.endm .endm
.data .data
.align 2
clean_addr: .word CLEAN_ADDR clean_addr: .word CLEAN_ADDR
.text .text
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment