This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

编译时一个变量出现地址编码出现警告



警告如下:

"../vlfftApps/func_master_SynDetect_FreMF.c", line 322: warning #17003-D: relocation from function "funcm_SynDetect" to symbol "mytestnum" overflowed; the 29-bit relocated address 0x1fe30b03 is too large to encode in the 15-bit unsigned field (type = 'R_C6000_SBR_U15_W' (13), file = "./vlfftApps/func_master_SynDetect_FreMF.obj", offset = 0x00000cac, section = ".text")

定义变量的方式如下

#pragma DATA_SECTION(mytestnum, ".externalMEM");
volatile int mytestnum;

在../vlfftApps/func_master_SynDetect_FreMF.c中声明如下

extern volatile int mytestnum;


对于编译的东西我不懂,我想知道的是

1.为什么重定位的时候会溢出?这个溢出是指后边的地址编码不能用15bit的无符号域来表示吗?

2. file = "./vlfftApps/func_master_SynDetect_FreMF.obj", offset = 0x00000cac, section = ".text"中,这个offset指的是"./vlfftApps/func_master_SynDetect_FreMF.obj"相对于 ".text"的位置吗?

3.对于出现的这个问题,我应该怎么解决。


  • 默认是near model,修改工程属性中的memory model为far试试,具体memory model的解释在spru186或spru187中有解释。

  • Andy Yin1 ,按照您说的改了之后,warning还存在,怎么解决?

    "/home/gtbldadm/ti/pdk_C6678_1_1_2_6/packages/ti/csl/csl_chipAux.h", line 140: warning #17003-D:
    relocation from function "platform_led" to symbol "platform_errno"
    overflowed; the 27-bit relocated address 0x7f78140 is too large to encode in
    the 15-bit unsigned field (type = 'R_C6000_SBR_U15_W' (13), file =
    "C:\ti\pdk_C6678_1_1_2_6\packages\ti\platform\evmc6678l\platform_lib\lib\deb
    ug\ti.platform.evm6678l.ae66<platform.obj>", offset = 0x00000d88, section =
    ".text")


  • 大神,遇到相同问题无法解决,更换编译器也没用,求解如何解决?