前两天刚好看到 ARM UCOS 汇编代码中用到PRESERVE8这个关键字(加在段定义之前),以前没见过的,于是百度。
1.汇编代码没有保持8字节栈对族段齐而调用C或C++代码。
2.ADS下的代码用RVDS2.2编译时,即使已经8字节栈对族胡齐,连接器也将之当作兆穗誉非8字节栈对齐。
所以要用伪指令指明一下。
E文不好,故而附原文以供参详:
where assembler code (that does not preserve 8-byte stack alignment) calls compiled C/C++ code (that requires 8-byte stack alignment), and
when attempting to link legacy SDT/ADS objects with RVCT 2.x objects. Legacy SDT/ADS objects that do not have these attributes are treated as '~PRES8', even if they do actually happen to preserve 8-byte alignment.
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)