CW10.1 Linker script change

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CW10.1 Linker script change

1,581 Views
mjbcswitzerland
Specialist V

Hi All

 

With CW7 it was typical to do something like the following in the linker script to position a file's content in a certain area of code:

 

    .flash1 :
    {
        Startup.s (.text)
        .                = ALIGN(0x10);
    } > flash1

 

With CW10.1, the same project and linker script was giving a linker error, saying that the file Startup.s can not be found.

 

After some comparing with linker scripts generated automatically for new CW10.1 projects it looks as though the file name is manipulated:

 

    .vectors :
    {
        exceptions_c.obj(.vectortable)
        . = ALIGN (0x4);
    } > vectorrom

 

The vector table being actually in a c-file called exceptions.c

 

So I tried the following:

 

    .flash1 :
    {
        Startup_s.s (.text)
        .                = ALIGN(0x10);
    } > flash1

 

and then it linked. In the map file the following was seen: 00000000 0000009C .text   .text    (Startup_s.obj)

Also all normal C-files are also referenced by something similar - eg. debug_c.obj (whereby the c-file is actually debug.c)

 

So it looks as though the linker does work a bit differently. The only problem is that it is now necessary to keep two sets of linker script files - one for use when working with CW7 and one for CW10.1.

 

Regards

 

Mark

Labels (1)
0 Kudos
Reply
1 Reply

905 Views
Aplamon
Contributor I

Just ran into this issue as well; thanks for the solution. This is not how the manual describes the behavior at all.

I have another similar problem. We include files as in

   INCLUDE bitmaps.bin

This doesn't work either, compiler complain about file not found even though the file is included in the project. Adding _bin does not work so I'm not sure what to do. Any help would be appeciated.

 

/Daniel

 

0 Kudos
Reply