提交 0d69d918 编写于 作者: Z Zhi-zhou Zhang 提交者: Daniel Schwierzeck

MIPS: fix a latent bug on initialize $gp

If bal is 8 bytes aligned, the _gp will not be 8 bytes aligned.
then the following ld insntrustion generates a Adel exception.
So here make _gp be always aligned in 8 bytes.
Signed-off-by: NZhi-zhou Zhang <zhizhou.zh@gmail.com>
Signed-off-by: NDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
上级 fd4d564b
......@@ -108,7 +108,12 @@ reset:
mtc0 t0, CP0_CONFIG
#endif
/* Initialize $gp */
/*
* Initialize $gp, force 8 byte alignment of bal instruction to forbid
* the compiler to put nop's between bal and _gp. This is required to
* keep _gp and ra aligned to 8 byte.
*/
.align 3
bal 1f
nop
.dword _gp
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册