首页 > 其他 > 详细

解决arm编译错误:~PRES8

时间:2014-03-05 17:29:20      阅读:449      评论:0      收藏:0      [点我收藏+]

arm工程uboot中的开始段start.s编译报错,提示

bubuko.com,布布扣

问题就是说:

在ARM上编程,但凡涉及到调用,就需要遵循一套规约AAPCS:《Procedure Call Standard for the ARM Architecture》。这套规约里面对栈使用的约定如下:

5.2.1.1
Universal stack constraints
At all times the following basic constraints must hold:
Stack-limit < SP <= stack-base. The stack pointer must lie within the extent of the stack.
SP mod 4 = 0. The stack must at all times be aligned to a word boundary.
A process may only access (for reading or writing) the closed interval of the entire stack delimited by [SP, stack-base – 1] (where SP is the value of register r13).
Note
This implies that instructions of the following form can fail to satisfy the stack discipline constraints, even when reg points within the extent of the stack.
ldmxx reg, {..., sp, ...} // reg != sp
If execution of the instruction is interrupted after sp has been loaded, the stack extent will not be restored, so restarting the instruction might violate the third constraint.
5.2.1.2
Stack constraints at a public interface
The stack must also conform to the following constraint at a public interface:
SP mod 8 = 0. The stack must be double-word aligned.

可以看到,规约规定,栈任何时候都得4字节对齐,在调用入口得8字节对齐。

解决办法在arm的错误问题库中也能够找到bubuko.com,布布扣

也就是在开头加入一行:PRESERVE8

bubuko.com,布布扣

这样就可以编译通过了  



解决arm编译错误:~PRES8,布布扣,bubuko.com

解决arm编译错误:~PRES8

原文:http://blog.csdn.net/weiwei_xiaoyu/article/details/20479493

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!