Closed qianfan-Zhao closed 5 months ago
@qianfan-Zhao how you know? Explain please
u-boot report the register values when bug happens, you can read the PC value:
data abort
pc : [<60000080>] lr : [<7ff974f0>]
disassembly the code in this location:
60000080: b4903004 ldrlt r3, [r0], #4
R0 is also printed by u-boot, it's value is r0 : 600001ee
, that is not a aligned value.
@qianfan-Zhao could you guess why the symbol was apparently aligned for the author (the pdf shows it at 600001ea)? maybe the linker version implicitly aligned it? just very curious :)
@qianfan-Zhao could you guess why the symbol was apparently aligned for the author (the pdf shows it at 600001ea)? maybe the linker version implicitly aligned it? just very curious :)
I think it is a behavier of the gcc, this code is developed at many years ago and gcc also has many versions this years.
Hi:
04_cenv example doesn't work on my qemu env, data abort bug happens, next is the u-boot logs:
Next is the asm code disassembly by objdump.
Seems data abort is trigger by unaligned memory access,
_text_end
is not an aligned address.Apply this patch to make sure text section aligned, this example can work fine again.
Now
_text_end
is an aligned address.