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

Wrong linker ZI data symbols

I'm linking my code without the use of a scatter file. As a constrain, I'm using the default region symbols

        IMPORT ||Image$$ER_RO$$Base||
        IMPORT ||Image$$ER_RO$$Limit||
        IMPORT ||Image$$ER_RO$$Length||

        IMPORT ||Image$$ER_RW$$Base||
        IMPORT ||Image$$ER_RW$$Limit||
        IMPORT ||Image$$ER_RW$$Length||

        IMPORT ||Image$$ER_ZI$$Base||
        IMPORT ||Image$$ER_ZI$$Limit||
        IMPORT ||Image$$ER_ZI$$Length||

The RO and the RW symbols are correct. The Image$$ER_ZI$$Base is reported correct, but the Image$$ER_ZI$$Limit is the same as the Base and, as a result, Image$$ER_ZI$$Length is 0.

At linking, I get the following message:

Program Size: Code=118868 RO-data=9832 RW-data=2456 ZI-data=206072


So there is ZI data.

Why are the two symbols, Image$$ER_ZI$$Base and Image$$ER_ZI$$Limit, equal and what can I do to correct this?

Thank you!

Parents
  • Thanks for the answer, David.

    I did manage to go around, though, by using Image$$ZI$$Base instead of Image$$ER_ZI$$Base and Image$$ZI$$Limit instead of Image$$ER_ZI$$Limit. The Image$$ER_ZI$$Length symbol is not available.

    Nevertheless, I did not use the symbols is my assembly code because, for an unknown reason, the RW data section gets messed up.

    Instead, I imported the symbols in my low level init C routine, and successfully used them from there.

    The code is something like this:

    extern int Image$$ZI$$Base;
    extern int Image$$ZI$$Limit;
    
    void AT91F_ClearBSS(){
    
            ushort *start, *end;
    
            start   = (ushort *)&Image$$ZI$$Base;
            end     = (ushort *)&Image$$ZI$$Limit;
    
            while(start<end){
                    *start = 0;
                    start++;
            }
    }
    

    Regards.

Reply
  • Thanks for the answer, David.

    I did manage to go around, though, by using Image$$ZI$$Base instead of Image$$ER_ZI$$Base and Image$$ZI$$Limit instead of Image$$ER_ZI$$Limit. The Image$$ER_ZI$$Length symbol is not available.

    Nevertheless, I did not use the symbols is my assembly code because, for an unknown reason, the RW data section gets messed up.

    Instead, I imported the symbols in my low level init C routine, and successfully used them from there.

    The code is something like this:

    extern int Image$$ZI$$Base;
    extern int Image$$ZI$$Limit;
    
    void AT91F_ClearBSS(){
    
            ushort *start, *end;
    
            start   = (ushort *)&Image$$ZI$$Base;
            end     = (ushort *)&Image$$ZI$$Limit;
    
            while(start<end){
                    *start = 0;
                    start++;
            }
    }
    

    Regards.

Children
No data