Mark Butcher

CW10.1 Linker script change

Discussion created by Mark Butcher on Mar 13, 2011
Latest reply on Mar 22, 2011 by Daniel Johansson

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 :
        . = 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.