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

Many small data blocks in CODE segment

Hi all,

In a project we have to use a small amount of static memory in every 2KByte ROM block. This is not normally a problem as the linker tries to fit any code where it can.

However, we now many many (a few hundred) small blocks of data - each one is completely automonous - but as they are defined in the same source file - the linker does not seem to want to split them up to fit around static memory allocations.

Here is an example :

BYTE CODE datablock_0316[10]={0x08,0x01,0xb5,0xbb,0x15,0xd4,0xf1,0x69,0x89,0xac};
BYTE CODE datablock_0318[10]={0x08,0x00,0x20,0x2b,0x59,0x4d,0x25,0xd1,0x65,0x48};
BYTE CODE datablock_0319[10]={0x08,0x01,0x88,0x11,0xaa,0x9d,0x72,0x40,0x6e,0x74};
BYTE CODE datablock_0321[10]={0x08,0x00,0xe7,0x3e,0xcf,0xb4,0x4b,0x2d,0x67,0x5f};
BYTE CODE datablock_0322[10]={0x08,0x01,0xf1,0xf5,0xa2,0x63,0xf6,0x25,0x91,0x58};

Note that BYTE is defined as unsigned char and CODE as code.

Is there a way of telling the linker that they can be split up?