【问题标题】:What is the IAR equivalent of __attribute__(section)什么是 __attribute__(section) 的 IAR 等价物
【发布时间】:2016-02-13 08:23:22
【问题描述】:

我可以直接使用__attribute__((section)),就像我在 arm gcc 中所做的那样,或者是否有任何相同的等价物.. 我的代码具有利用上述构造(通过宏定义)的功能..

#define PLACE_IN_REGION1 __attribute((section(".section1")))

void function( int ) PLACE_IN_REGION1;

如果存在类似的等价物,我可以毫不费力地替换它..

【问题讨论】:

    标签: gnu-make gnu ld iar


    【解决方案1】:

    您可以使用location pragma,以预处理器宏的形式:

    #define PLACE_IN_REGION1 _Pragma("location=\"section1\"")   // section1 is region you have defined in the linker file
    PLACE_IN_REGION1 void function(int); 
    

    唯一的区别是它需要在声明的开头,所以你需要稍微编辑一下你的代码。

    【讨论】:

      猜你喜欢
      • 2014-10-26
      • 1970-01-01
      • 1970-01-01
      • 2020-05-29
      • 1970-01-01
      • 2014-05-08
      • 2014-06-12
      • 1970-01-01
      相关资源
      最近更新 更多