2.1 函数: 函数放到 0x20000地址
intsqr(int n1) __attribute__((section(".ARM.__at_0x20000")));
intsqr(int n1)
{
return n1*n1;
}
2.2 数据 : 数组放到0x4000地址
const uint8_tg_pui8BootImage[16] __attribute__((at(0X04000))) =
{
0x00, 0x02, 0x00,0x10, 0x89, 0x4D, 0x00, 0x00,
0xD9, 0x4D, 0x00, 0x00, 0xE1, 0x4D, 0x00, 0x00
};
DONE!