|
Keil版本: Keil MDK4
有如下代码:
void func()
{
//...do something
printf("I hope to be recognized as RO-DATA!\n");
}
但是查看编译之后的.map和反汇编,发现该字符串未被认成RO-DATA section,反汇编如下:
------------------------------------------------------------------------------------------------------------------
func
0x00002c44: b510 .. PUSH {r4,lr}
0x00002c46: a013 .. ADR r0,{pc}+0x4e ; 0x2c94
0x00002c48: f000fc9a .... BL printf ; 0x3580
;; some other codes for RO-CODE section
$d
;; the string is here!
0x00002c94: 6f682049 I ho DCD 1869094985
0x00002c98: 74206570 pe t DCD 1948280176
0x00002c9c: 6562206f o be DCD 1700929647
0x00002ca0: 63657220 rec DCD 1667592736
0x00002ca4: 696e676f ogni DCD 1768843119
0x00002ca8: 2064657a zed DCD 543450490
0x00002cac: 52207361 as R DCD 1377858401
0x00002cb0: 41442d4f O-DA DCD 1094987087
0x00002cb4: 0a214154 TA!. DCD 169951572
0x00002cb8: 00000000 .... DCD 0
------------------------------------------------------------------------------------------------------------------
于是,造成我无法通过scatter file来分离RO-CODE和RO-DATA到不同的区域(我本想将这个字符串放在0x100000地址处的)。
请教一下各位高手,如何做才能使linker将这个字符串认成RO-DATA?谢谢!
|
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|