Skip to content
Snippets Groups Projects
Commit adc421e4 authored by Albert ARIBAUD's avatar Albert ARIBAUD Committed by Tom Rini
Browse files

arm: move gd handling outside of C code


As of gcc 5.2.1 for Thumb-1, it is not possible any
more to assign gd from C code, as gd is mapped to r9,
and r9 may now be saved in the prolog sequence, and
restored in the epilog sequence, of any C functions.

Therefore arch_setup_gd(), which is supposed to set
r9, may actually have no effect, causing U-Boot to
use a bad address to access GD.

Fix this by never calling arch_setup_gd() for ARM,
and instead setting r9 in arch/arm/lib/crt0.S, to
the value returned by board_init_f_alloc_reserve().

Signed-off-by: default avatarAlbert ARIBAUD <albert.u.boot@aribaud.net>
Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
parent ecc30663
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment