investigating RAM usage with nm / diff. between "nm" and "size" ?

Nick Clifton nickc@redhat.com
Tue Feb 10 11:57:00 GMT 2004


Hi Greg,

> I'm trying to use the nm command in order to understand how a
> program makes use of RAM and how to reduce RAM requirements. My
> program is supposed to be embedded, so RAM is very limited.
>
> Using, the nm command to list symbols in the program, the last
> symbol in the .bss section occurs at address 0xd0fe8. This also
> matches the last address in the section reported by the linker map.
>
> The .bss section starts at 0xd0000, so that should mean my program
> uses 4072 bytes of RAM (?).
>
> However, my concern is that when I use the size command, it reports
> only 3336 bytes in the .bss section.
>
> Do you know why these differ?

Which version of the tools are you using ?  Possibly it is an old
version with a bug in it.

A way to reproduce the problem would be very helpful too.  Maybe you
could send a *small* object file which demonstrates the problem ?

Cheers
        Nick
        



More information about the Binutils mailing list