Attached is a main.c, memory.x and main.map file. The memory.x file causes bss to come before .data. The map file shows the PROVIDE for __bss_start that the init program uses to be at 0x201 and that __bss_size is 0x6. .data starts at 0x206. This results in the first byte of data getting cleared after bss initializes.
The architecture is the msp430g2553 and the linker script just add SECTION to that base memory.x file.
It is compiled and linked with this command:
msp430-gcc -mmcu=msp430g2553 -Wl,-Map=main.map -o main main.c
Log in to post a comment.