Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Why is the stack origin at 0x0400 on mspgcc?

$
0
0

Hi,

Once I switched my project from TI compiler (CCS5.3) to mspgcc I was surprised to see the .bss section to decrease from 341 to 178 bytes (MSP430G2553). So I started to dig into the memory map and symbol list to compare those 2 outputs.

 

TI: 

RAM                   00000200   00000200  00000155  000000ab  RWIX

mspgcc, $msp430-read test.elf

   text    data     bss     dec     hex filename
  10666       0     178   10844    2a5c test.elf

 

Now, I can see that the TI locates the stack of 80 bytes (0x50) at the address of 0x03b0:

.stack     0    000003b0    00000050     UNINITIALIZED
                  000003b0    00000002     rts430_eabi.lib : boot.obj (.stack)
                  000003b2    0000004e     --HOLE--
while the mspgcc does it after the RAM area (0x0400 - how is that possible?):

 

$msp430-readelf -s test.elf 

129: 00000400     0 NOTYPE  GLOBAL DEFAULT  ABS __stack

I have not ran this program yet on my hardware as I decomposed all wire connections so I have no idea whether it works or not but I do not understand this stack thing itself - could you please give a hint to the newbie what to read about, where to look for explanation? How is that possible the 341 bytes of .bss dropped down to 178 on the same source code?

 

Best Regards,

tml

 

 


Viewing all articles
Browse latest Browse all 2077

Trending Articles