»
Quick Links
Page 1 of 1
a link error when build PI codes use RVCT3.1
#1
Posted 28 March 2012 - 01:48 AM
i get the below link error when compiled with --apcs /ropi under rvct3.1 (while ads1.2 don't have this problem):
Error: L6248E: al_thumb.o<aApp_ENGINE_AS> in PI region 'ER_RO' cannot have address type relocation to Image$$RO$$Limit in PI region 'ER_RO'
and if i comment out " ldr r2,=|Image$$RO$$Limit| " in al_thumb.s, this error can be eliminated.
can any body tell me what's the problem ? how can i solve it ? thanks!
Error: L6248E: al_thumb.o<aApp_ENGINE_AS> in PI region 'ER_RO' cannot have address type relocation to Image$$RO$$Limit in PI region 'ER_RO'
and if i comment out " ldr r2,=|Image$$RO$$Limit| " in al_thumb.s, this error can be eliminated.
can any body tell me what's the problem ? how can i solve it ? thanks!
#3
Posted 28 March 2012 - 03:54 PM
The problem with the (pseudo) instruction
is that |Image$RO$Limit| *is* position-independent. Effectively the linker is saying "I can't tell what the value of |Image$RO$Limit| is going to be at runtime because it's defined in a position-independent section. (Well, not 'in' exactly, but you know what I mean.) And I don't know the run-time addresses of position-independent sections."
[ADS shouldn't have let you link with --ropi either; I wonder what it did do.]
What use is the code making of |Image$RO$Limit|? It's kindof a suspect thing to want to determine in position-independent code.
If you're sure that you really want that value, I suspect the easiest way to get it is to compile the following --apcs /ropi and either just call the function or examine what the compiler does to determine the value.
LDR r2,=|Image$RO$Limit|
is that |Image$RO$Limit| *is* position-independent. Effectively the linker is saying "I can't tell what the value of |Image$RO$Limit| is going to be at runtime because it's defined in a position-independent section. (Well, not 'in' exactly, but you know what I mean.) And I don't know the run-time addresses of position-independent sections."
[ADS shouldn't have let you link with --ropi either; I wonder what it did do.]
What use is the code making of |Image$RO$Limit|? It's kindof a suspect thing to want to determine in position-independent code.
If you're sure that you really want that value, I suspect the easiest way to get it is to compile the following --apcs /ropi and either just call the function or examine what the compiler does to determine the value.
extern const char Image$RO$Limit[];
const void *get_RO_Limit() { return Image$RO$Limit; }
Share this topic:
Page 1 of 1














