arm 变量或数组放置在指定地址

来源:互联网 发布:网络信息推广 编辑:程序博客网 时间:2024/06/14 10:43

语法

__attribute__((at(address)))

其中:

address

是所需的变量地址。

限制

链接器并非始终能够放置 at 变量属性生成的节。

错误

如果无法将节放置在指定地址,链接器将显示一条错误消息。

示例

const int x1 __attribute__((at(0x10000))) = 10; int x2 __attribute__((at(0x12000))) = 10;       int x3 __attribute__((at(0x14000))) = 0;        int x4 __attribute__((at(0x16000)));            

另请参阅

 

 

uint32 const EnCode __attribute__((at(0x1FC))) 0x87654321; 

或者加入:

#include <absacc.h>
 const char MyText[] __at (0x1F00) = "TEXT ATADDRESS 0x1F00";

0 0
原创粉丝点击