Hi Dugufei,
I sometimes get this error when trying to access data in a different section. I have a section of battery-backed SRAM, away from the RAM used for my code and bss. To put something in the NVR I have to use:
# define COMM_NVR __attribute__((section(".common_nvr")))
// example of putting variable in NVR.
unsigned char fred COMMON_NVR;
When I want to access fred from another file I have to:
extern unsigned char fred COMMON_NVR;
If I forget to add the COMMON_NVR attribute then I get the linker error you describe, 'Can't reach....'.
So maybe your unreachable variable isn't where you think it is.
Banx.