The size of an object on disk is misleading, it contains comments,
notes, relocations, debug sections etc. which are discarded when
vmlinux is built, as well as init sections which are reused after the
kernel has booted. Also the on disk size completely excludes bss, the
bss area is created and zeroed at load time. ls -l on a kernel object
is not a good test, use size -A instead. On a 2.4.19 system :-
# ls -l net/ipv4/ipv4.o
-rw-r--r-- 1 kaos ocs 338885 Sep 29 13:59 net/ipv4/ipv4.o
# size -A net/ipv4/ipv4.o
net/ipv4/ipv4.o :
section size addr
.text 216368 0
.text.init 2784 0 reused after boot
.fixup 411 0
.rodata 1442 0
.rodata.str1.32 13280 0
.rodata.str1.1 2992 0
__ex_table 288 0
.data 11024 0
.data.cacheline_aligned 192 0
.initcall.init 4 0 reused after boot
.bss 46464 0 not on disk, but occupies kernel space
.comment 1815 0 not loaded into the kernel
.note 660 0 not loaded into the kernel
Total 297724 misleading!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/