How to get to know a used data memory in gcc?

Help
Pandit Nad
2009-05-15
2013-03-06
  • Pandit Nad
    Pandit Nad
    2009-05-15

    Hi,
      I'm Pandit. I'm doing with msp430 programming using MSPGCC compiler. I have little doubt about knowing a data memory used by the project. Actually after loading the code onto the chip it'll show like this:

    Erasing target flash - all... Erased OK
    load debug/bootloader.elf
    Loading section .text, size 0x2da lma 0x8000
    Loading section .data, size 0x82 lma 0x82da
    Loading section .vectors, size 0x20 lma 0xffe0
    Start address 0x8000, load size 892
    Transfer rate: 1 KB/sec, 297 bytes/write.

    Loading section .data, size 0x82: This size only refers to the initialized variables. Means any variables intialized some values like this:

    uint8_t halSwCnt=0,flag=0;
    uint16_t halAdcVal = 0;

    If i didn't initialize to zero. It'll not show the data size for this. How to get to know the data size for this.
    For this type variables i can initialize to zeros but for an array type of variables its difficult to initialize to zero.
    If i define array variable like this:

    uint8_t Buf[200];
    It'll not show this in data mem size. Please tell me how to get to know this size.

    Thanks&Regards,
    Pandit

     
    • try msp430-objdump -h file.elf. It will print all sections addresses and sizes.
      uint8_t Buf[200]; goes into .bss section.