This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: investigating RAM usage with nm / diff. between "nm" and "size" ?
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: <heinricg at esiee dot fr>
- Cc: binutils at sources dot redhat dot com
- Date: 10 Feb 2004 10:44:17 -0500
- Subject: Re: investigating RAM usage with nm / diff. between "nm" and "size" ?
- References: <20040210101710.D83EF3658EF@mail.esiee.fr>
<heinricg@esiee.fr> writes:
> 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?
What tells you that the .bss section starts at 0xd0000? That is not a
typical address for the .bss section; the .bss section typically
starts just after the end of the .data section, and thus is typically
not on a page boundary.
It would also help if you indicated which target you are using, and
whether you are using a custom linker script.
Ian