This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

where is my memory (.bss) used ? size vs. nm


Hi,

I thought I'd check the memory requirements of a small application:

$ arm-elf-size smallapp
   text    data     bss     dec     hex filename
 172171    3032   16940  192143   2ee8f Project

Ok, bss is 16940 bytes. So who uses them ?

$ arm-elf-nm -S -C -r --size-sort smallapp
0004bd8c 00002000 B stack
000387b8 00001010 T vfnprintf
00024138 00000e7c t _vprintf(void (*)(char, void**), void**, ...
0003b658 00000b50 t construct_converter(Cyg_Clock::converter*,...
00041960 0000099c T Cyg_Mempool_dlmalloc_Implementation::resize_alloc(...
00037728 0000090c T Cyg_Condition_Variable::wait_inner(Cyg_Mutex*)
000336dc 000005f0 T Cyg_Mbox::put(void*, unsigned long long)
0003f334 000005d8 T realloc
...

This gave me a long list of information, so I wrote a small script (in ruby, you can find it in the attachement) to add all the sizes which go in the .bss section, marked with a "B":

$ arm-elf-nm -S -C -r --size-sort Project | ruby add.rb
bss size: 10120

Hmm, the sum of all sizes which go to .bss is 6000 bytes less then the size reported by arm-elf-size. 
Can you enlighten me how to interpret these data ?

Bye
Alex

Attachment: add.rb
Description: add.rb

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]