How to place a variable at a given absolute address in memory (with GCC)

后端 未结 5 1795
野的像风
野的像风 2020-11-29 08:28

The RealView ARM C Compiler supports placing a variable at a given memory address using the variable attribute at(address):

int var __attribute_         


        
5条回答
  •  野性不改
    2020-11-29 08:50

    You could use the section attributes and an ld linker script to define the desired address for that section. This is probably messier than your alternatives, but it is an option.

提交回复
热议问题