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.

C5500 New Linker problem introduced recently



 

Below is simple code example to see the problem. It appears to be a problem in the cl55 linker in resolving addresses for certain structures in the .const section.

 

/****************************************************************************/

struct XXX {

     const struct XXX *z; // next state to switch to

     };

struct YYY {

     struct YYY *z; // next state to switch to

     };

const struct XXX xxx[]={xxx};

struct YYY yyy[]={yyy,(struct YYY *)xxx};

 

int main(int argc, char *argv[])

{

     printf("&xxx:0x%x, xxx[0].z:0x%x\n",&xxx,xxx[0].z);

     printf("&yyy:0x%x, yyy[0].z:0x%x, yyy[1].z:0x%x\n",&yyy,yyy[0].z,yyy[1].z);

return(0);

}

/****************************************************************************/

 

 

Run the program and get the following output:

&xxx:0x695d, xxx[0].z:0xd2ba

&yyy:0x246b, yyy[0].z:0x246b, yyy[1].z:0x695d

 

As you can see, where xxx[] is const (.const) and yyy is not (.bss), the linker initializes with byte addresses, as shown in red. Our previous revision tools (CCS3.3 v3.3.2 or CCS v3.1) do not have this problem so it crept in within the past year or so. Is there any linker command-line option that affects this?