Hi all,
I'm watching the elf image .data section and have sorted all the symbols offsets with the following command:
/usr/local/avr/bin/avr-objdump -t image.elf --demangle |grep "\.data" |awk '{print "0x" $0}' |sort -n
If I sum up all the reported symbol's sizes I get about 5.4KB. If I watch the sections size with this command:
/usr/local/avr/bin/avr-objdump -h image.elf
I get this
Idx Name Size VMA LMA File off Algn 0 .text 0002c288 00000000 00000000 00000094 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .data 00002ee6 00802000 0002c288 0002c31c 2**0 CONTENTS, ALLOC, LOAD, DATA
and the .data section size turns out to be 12KB.
Now, once I watched the symbols offsets and sizes more carefully I noticed that there are several misalignments ("holes") between the offsets differences and the symbols sizes, as is shown in the following example:
0x008049cb w O .data 0000000e vtable for os_msg_queue_if_t 0x00804a18 w O .data
As you see 0x4a18 - 0x49cb = 0x4D which is >> 0xE. Am I missing something / doing something wrong? I understand there can be static data that is not shown in the symbols, but to have 12 - 5.4 =6.6KB of static data is odd to me.
Is this related to the "impure data" ? because I don't see the "impure_data" symbol in the list.
Funny thing is the same code compiles on a cortex M3 and only eats up 980B of ram in the data section (of which 400B are for impure_data).
So I'm losing about 4K for vtables and other 6.6K for something which I don't know.
I'm sorry not to be specific enough but can you suggest me something to investigate or something to report to you in order to focus the problem?
Thanks in advance.
R