Commit b505caa5b83e42130772d9b3804c459d09ad6e10

Authored by Manfred Schlaegl
Committed by Peng Fan
1 parent 95b2ee328e

ARM: fixed relocation using proper alignment

Using u-boot-2017.05 on i.MX6UL we ran into following problem:
Initially U-Boot could be started normally.
If we added one random command in configuration, the newly generated
image hung at startup (last output was DRAM:  256 MiB).

We tracked this down to a data abort within relocation (relocated_code).

relocated_code in arch/arm/lib/relocate.S copies 8 bytes per loop
iteration until the source pointer is equal to __image_copy_end.
In a good case __image_copy_end was aligned to 8 bytes, so the loop
stopped as suggested, but in an errornous case __image_copy_end was
not aligned to 8 bytes, so the loop ran out of bounds and caused a
data abort exception.

This patches solves the issue by aligning __image_copy_end to 8 byte
using the linker script related to arm.

From Community: http://patchwork.ozlabs.org/patch/760592/

Signed-off-by: Peng Fan <peng.fan@nxp.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

arch/arm/cpu/u-boot.lds
... ... @@ -165,7 +165,7 @@
165 165 *(.__efi_runtime_rel_stop)
166 166 }
167 167  
168   - . = ALIGN(4);
  168 + . = ALIGN(8);
169 169  
170 170 .image_copy_end :
171 171 {