MSPGCC memory mapping problem

Mar 21, 2008 4 Replies

Hi,



I'm trying to move some variables around by assigning them my own sections with the section attribute, such as this:



struct info_data_flash Data_Flash_A __attribute__((section(".infoA"))); // resides at 0x10C0



I believe the problem is with the compiler because of the addresses given in the output error:



.bss [00000238 -> 000002cd] overlaps section .infoB [00000200 ->



0000023f]

I get an error for .infoA too, but that tells me that .data is full.



I can see that .infoB has the right size ending at 0x3f above 0x200, but why is it still in the .bss section? I explicitly moved it to .infoB



Any help is appreciated...


-Ryan



I hate messing around with those funky gcc bracketfests. A more "portable" (if I may misuse the word that way) method of achieving the same thing is:

typedef struct INFO_MEM_STRUCT { unsigned char raw_data[64]; // and/or put in a union here } INFO_MEM_STRUCT, *PINFO_MEM_STRUCT;

PINFO_MEM_STRUCT infoA =3D (PINFOMEM) 0x200, infoB =3D (PINFOMEM) 0x240; // or whatever your addresses are

Since those messages almost certainly come from the linker, not the compiler, I believe you're mistaken.

That's not what the message is telling you. It states that the two sections overlap, i.e. you tried to locate two sections in the same space. Don't do that, and things will have a chance to work.

Thanks Hans,

I figured this one out.

The messages do come from the linker, but it's becuase the compiler was also doing some linking. I used the -c flag (compile/assemble only) for msp430-gcc and was able to prevent problem.

You misunderstand how the GCC toolchain works. The command you call, gcc, is _not_ the compiler. It's a frontend program for the entire toolchain, including the linker. The actual compiler (named "cc1"), the assembler and all other tools needed, are called by gcc as necessary.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required