This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

a link error when build PI codes use RVCT3.1

Parents
  • Note: This was originally posted on 28th March 2012 at http://forums.arm.com

    The problem with the (pseudo) instruction

    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; }
Reply
  • Note: This was originally posted on 28th March 2012 at http://forums.arm.com

    The problem with the (pseudo) instruction

    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; }
Children
No data