把ADS的文件放到RVDS2.2的工程里,make时出现invalid call from '~PRES8' function to 'REQ8'...

google加ARM网站,找到一段解释:

This RVDS/RVCT linker error is given where a stack alignment conflict is detected in object code. The "ABI for the ARM Architecture" demands that code maintains 8-byte stack alignment at its interfaces. This allows efficient use of LDRD and STRD instructions (in ARM Architecture 5TE and later) to access 8-byte-aligned "double" and "long long" data types.

Symbols like '~PRES8' and 'REQ8' are "Build Attributes" of the objects.

  • PRES8 means the object PREServes 8-byte alignment of the stack.
  • ~PRES8 means the object does NOT preserve 8-byte alignment of the stack (~ meaning NOT).
  • REQ8 means the object REQuires 8-byte alignment of the stack.

This link error typically occurs in two cases:

  • 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.

For example:
Error: L6238E: foo.o(.text) contains invalid call from '~PRES8' function to 'REQ8' function foobar

This means that there is a function in the object foo.o (in the section named .text) that does not preserve 8-byte stack alignment, but which is trying to call function foobar that requires 8-byte stack alignment.

A similar warning that may be encountered, where the address of an external symbol is being referred to, is:
Warning: L6306W: '~PRES8' section foo.o(.text) should not use the address of 'REQ8' function foobar

Solutions
There are two possible approaches to dealing with this issue:

1) If you have access to all your source code and are allowed to rebuild it
In this case you should rebuild all your objects/libraries using the latest version of the compilation tools. Note that if you have any assembler files, you will need to:

i) check that all instructions preserve 8-byte stack alignment, and if necessary, correct them.
e.g. change:

        STMFD sp!, {r0-r3, lr} ; push an odd number of registers 

to:

        STMFD sp!, {r0-r3, r12, lr} ; push an even number of registers 

and:

ii) add the PRESERVE8 directive to the top of each assembler file.
e.g. change:

        AREA Init, CODE, READONLY 

to:

        PRESERVE8AREA Init, CODE, READONLY 

(the PRES8 attribute applies to the whole object, not just the code section).

2) If you cannot rebuild all of your source code
If you have any legacy objects/libraries that cannot be rebuilt, either because you do not have the source code, or because the old objects must not be rebuilt (e.g. for qualification/certification reasons), then you must inspect the legacy objects to check whether they preserve 8-byte alignment or not. Use "fromelf -c" to disassemble the object code. C/C++ code compiled with ADS 1.1 or later will normally preserve 8-byte alignment, but assembled code will not.

If your objects do indeed preserve 8-byte alignment, then the linker error L6238E can be suppressed with the use of "--diag_suppress 6238" on the linker command line. By using this, you are effectively saying "I guarantee that these objects are PRES8". The linker warning L6306W is suppressible with "--diag_suppress 6306".
If you are linking with legacy objects/libraries then you should also read the information on the option "--apcs /adsabi" in the FAQ entry "Are legacy ADS objects/libraries compatible with RVCT 2.0 ?".

我对这个问题的解决如下:

在我的文件中加入了

PRESERVE8
e.g. change:
        AREA Init, CODE, READONLY 
to:
        PRESERVE8AREA Init, CODE, READONLY


												

ADS转RVDS invalid call from '~PRES8' function to 'REQ8' function相关推荐

  1. test.axf: Error: L6238E: cpu_asm.o(test) contains invalid call from '~PRES8

    从周立功网站下载的"Keil uVision3在EasyARM系列开发板上的工程模板"包含两个文件夹,分别是EasyARM2100和EasyARM2200.该两个模板对应的开发板分 ...

  2. R语言构建xgboost模型:自定义损失函数(目标函数、loss function、object function)、评估函数(evaluation function)

    R语言构建xgboost模型:自定义损失函数(目标函数.loss function.object function).评估函数(evaluation function) 目录

  3. 关于JavaScript中Function Declaration与Function Expression的进一步说明

    区分变量与对象 在讨论函数声明与函数表达式之前,我觉得有必要明确一下JavaScript中变量及对象的区别.具体来说: JavaScript中的对象(Object)是一个实体,而变量(Variable ...

  4. sigmoid function vs softmax function

    DIFFERENCE BETWEEN SOFTMAX FUNCTION AND SIGMOID FUNCTION 二者主要的区别见于, softmax 用于多分类,sigmoid 则主要用于二分类: ...

  5. JS-立即执行函数(function(){...})() amp;amp; (function(){...})()

    在学习闭包的过程中遇到了(立即执行),之前见到(function(){...})() && (function(){...}())这种写法,就没有去知其所以然,也不会去写这种函数.所以 ...

  6. 区别 (function($){...})(jQuery)、$(function(){ })和$.fn

    一.(function($){-})(jQuery) 首先function(arg){...}定义了一个匿名函数,参数为arg,而调用时需要在函数后面写上括号和实参,由于操作符的优先级,函数本身也需要 ...

  7. Function function 隐式function

    //****** Function & function & 隐式function// Function 是javaScript中的保留字,用来显式的定义函数对象. 前n个参数作为定义 ...

  8. (function($){...})(jQuery)、$(function(){ })和$.fn

    部分转自:http://blog.csdn.net/rambo_china/article/details/7742321 表示感谢! (function($){-})(jQuery) 首先funct ...

  9. 前端之jquery-jQuery中$(function(){})与(function($){})(jQuery)、$(document).ready(function(){})区别

    1.(function($){...})(jQuery);(1).原理:这实际上是匿名函数,如下:function(arg){...}这就定义了一个匿名函数,参数为arg:而调用函数是,是在函数后面写 ...

最新文章

  1. ecmall数据库表详解 二次开发必备
  2. (转载)C++之tinyXML使用
  3. 【windows】python安装小结
  4. MapReduce-流量统计求和-分区代码实现
  5. hybris使用impEx导入产品主数据的示例脚本
  6. html中如何让字段闪烁,Javascript结合CSS实现边框闪烁提示
  7. 优化搜索排序结果从而“ 提升CTR、CVR业务指标”
  8. mysql 表引擎 entity framework_EntityFramework之数据库以及表基本创建(一)
  9. Go -- 并发编程的两种限速方法
  10. 计算机组成原理学习四笔记一
  11. 190323每日一句
  12. 2022 VMware下载安装教程
  13. 【推荐】智慧数字城管执法综合应用平台可视化系统建设架构解决方案合集(共202份,920M)
  14. 3D游戏编程大师技巧读书笔记(第一章)
  15. 《ZigBee开发笔记》第五部分 外设篇 - 基础实验 第4章 CC2530热释电红外传感器
  16. 苹果屏幕上的小圆点_今天才发现,苹果手机点一下屏幕就能截图,还支持长截图学到了...
  17. Microsoft edge浏览器下载速度太慢怎么办?今天我手把手教你提速
  18. TLC2543和TLV5614的STM32程序
  19. 小白月赛26:E牛牛走迷宫(BFS)
  20. CMDN Club #23 开放平台和O2O移动产品开发

热门文章

  1. 【转】Android权限获取机制与常见权限不足问题分析
  2. C#使用SiteMapPath控件显示地图导航
  3. Linux的系统架构(linux由哪几部分组成?)
  4. 裤子千万条,棉裤第一条!南方的小伙伴你穿棉裤吗?
  5. AutoCAD二次开发基础(三):船体型线绘制
  6. 中国社会信任的解体及其结果(zt)
  7. NQA、Track联动监测ISP链路状态
  8. C++ ID3决策树
  9. 一文看懂-ElasticSearch全文搜索引擎
  10. 快速搭建一款输入法(前端UI搭建)