<span class="gmail_quote">On 1/31/06, <b class="gmail_sendername">Olwe Bottorff</b> <<a href="mailto:galanolwe@yahoo.com">galanolwe@yahoo.com</a>> wrote:</span><br>
<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">$ size hello_world-1 hello_world-1.o<br> text data bss dec hex filename<br>
916 256
4 1176 498 hello_world-1<br>
48 0
0 48 30
hello_world-1.o<br><br>$ objdump -h hello_world-1.o<br><br> hello_world-1.o: file format elf32-i386<br><br> Sections:<br>
Idx
Name Size VMA
LMA<br>File off Algn<br> 0
.text
00000023 00000000 00000000<br>00000034 2**2<br>
CONTENTS, ALLOC, LOAD, RELOC,<br>READONLY, CODE<br>
1 .data
00000000 00000000 00000000<br>00000058 2**2<br>
CONTENTS, ALLOC, LOAD, DATA<br> 2
.bss 00000000 00000000 00000000<br>00000058 2**2<br> ALLOC<br> 3 .rodata 0000000d 00000000 00000000<br>00000058 2**0<br>
CONTENTS, ALLOC, LOAD, READONLY,<br>DATA<br> 4 .note.GNU-stack 00000000 00000000 00000000<br>00000065 2**0<br>
CONTENTS, READONLY<br> 5 .comment 0000001b 00000000 00000000<br>00000065 2**0<br>
CONTENTS, READONLY<br><br><br>You see that objdump object file says text is size 23,<br>while size says it's 48. There's a 25 byte<br>discrepency. Why? It seems to be the exact size of the<br>entire printf... line in the code (plus a \0?). Any ideas?
</blockquote><div><br>
size is listing the text size in base 10. objdump is listing it
in
base 16. Also objdump is using more finely grained categories. So
the 48 bytes of text in size have become 0x23 bytes in .text and 0xd
bytes in .rodata, which conveniently enough, adds up to 0x30 hex, which
is 48 bytes. Someone that knows more about it/has had to care at
some point, can explain why the size/bytes are where they are according
to size and objdump.<br>
<br>
leif<br>
</div><br>
</div><br>