This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Is there a way to know the amount of data-memory being used by a binary?

Other Parts Discussed in Thread: TM4C123GH6PM

Hi All.

I have been compiling binaries using the linux-tool-chain, and was just wondering if there is a tool wherein I can get to know the amount of data-memory being required by the binary (I am guessing I am beginning to reach the boundary of 32 KB, so just want to be sure).

Will be grateful for any pointers.

Thanks and Regards,

Ajay

  • Generate a map file.

    It will be of limited help with stack and heap but all static allocations will show.

    Robert
  • Generate a map file.

    Or, if you just have a binary, the objdump utility (GNU binutils) might be helpful.

  • Sounds suspiciously as if poster is "bumping against" the code-size limits (i.e. "boundary") of his IDE.  

    Should this "prove the case:"

    • (some) have divided their programs to remain w/in "boundary" - creating a separate program (and/or modules) when the limit is exceeded
    • expanded to a 2nd (eval) board which carries the "overflow" code & runs in cooperation w/the main (first) board
    • bit the bullet and (God forbid) purchased the program

    Method 2 requires the skill & patience of Symphony Conductor - but we've seen it done... proves the concept...

  • Hi f.m.

    I tried using objdump, but it says that the file-format is not supported :(

    Anyway to overcome this? I am using the linux-tool-chain, and compiling with options -DPART_TM4C123GH6PM -DTARGET_IS_BLIZZARD_RA1

     


    Thanks for all the help.

  • Hi,

    Use: arm-non-eabi-objcopy -O binary your_elf_file your_bin_file.

  • I tried using objdump, but it says that the file-format is not supported :(

    Make sure you call the utility from the cross-toolchain (usually named arm-non-eabi-objdump), and not the linux-native one. The latter (host binary) most probably only supports x86 objects/binaries.

    But as suggested before, a map file is the better alternative.

    And, if cb1 is correct and you are about to "hit" a size constraint of the IDE, consider a purchase, or another toolchain.

  • Oops.... I am an idiot of course.

    Of course I was using the linux objdump :(
    Using the toolchain-objdump gave me all the information I required.

    Sorry for everyone's time, and a big thanks for everyone's help.
  • And this 32KB (boundary) mattered because...?