#346 bss initialization overwrite bss with customer memory.x file


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


  • Robert Henig

    Robert Henig - 2013-02-23

    source files

  • Peter A. Bigot

    Peter A. Bigot - 2013-02-23
    • status: open --> closed-invalid
  • Peter A. Bigot

    Peter A. Bigot - 2013-02-23

    Your linker script is not valid: memory.x is included into the standard script resulting in the declarations that belong in .bss being placed out of order relative to the constants that are required by the CRT routines.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks