- MSPGCC memory mapping problem
- Posted by rswartze on March 21st, 2008
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
- Posted by larwe on March 22nd, 2008
On Mar 21, 2:21*pm, rswartze <rswar...@sbcglobal.net> wrote:
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 = (PINFOMEM) 0x200, infoB = (PINFOMEM) 0x240;
// or whatever your addresses are
- Posted by Hans-Bernhard Bröker on March 22nd, 2008
rswartze wrote:
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.
- Posted by rswartze on March 24th, 2008
On Mar 22, 6:40*am, Hans-Bernhard Bröker <HBBroe...@t-online.de>
wrote:
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.
- Posted by Hans-Bernhard Bröker on March 24th, 2008
rswartze wrote:
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.