Size of binary
Hinko Kocevar
hinko.kocevar at cetrtapot.si
Wed Aug 20 12:59:37 UTC 2008
Hi all,
We are using uClibc libc on our embedded target system running on Axis ETRAX LX100 CPU - cris architecture.
For quite some time Axis provides only 0.9.27 version of uClibc. Following the discussion on openwrt and uclibc buildroot mailing lists I managed to get uClibc 0.9.29 working on cris.
The problem is the of the final binary. Here are results:
hinkok at alala /work/hello $ cat hello.c
#include <stdio.h>
int main (void)
{
printf("FU");
return 1;
}
0.9.27
------
$ gcc_cris -mlinux -muclibc=/fw/afc2_R1.gen/stage.uclibc hello.c -o _hello_cris_old_uclibc_dyn
$ ls -l _hello_cris_old_uclibc_dyn
-rwxr-xr-x 1 hinkok hinkok 2196 Aug 20 14:52 _hello_cris_old_uclibc_dyn
hinkok at alala /work/hello $ /usr/local/cris/bin/cris-axis-linux-gnu-readelf -l _hello_cris_old_uclibc_dyn
Elf file type is EXEC (Executable file)
Entry point 0x80234
There are 5 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000034 0x00080034 0x00080034 0x000a0 0x000a0 R E 0x4
INTERP 0x0000d4 0x000800d4 0x000800d4 0x00014 0x00014 R 0x1
[Requesting program interpreter: /lib/ld-uClibc.so.0]
LOAD 0x000000 0x00080000 0x00080000 0x00288 0x00288 R E 0x2000
LOAD 0x0002a0 0x000822a0 0x000822a0 0x000a4 0x000c0 RW 0x2000
DYNAMIC 0x0002a8 0x000822a8 0x000822a8 0x00088 0x00088 RW 0x4
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .interp .hash .dynsym .dynstr .rela.plt .plt .text .rodata
03 .data .dynamic .got .bss
04 .dynamic
0.9.29
------
$ /work/stage/buildroot/build_cris/staging_dir/usr/bin/cris-linux-uclibc-gcc hello.c -o _hello_cris_new_uclibc_dyn
$ ls -l _hello_cris_new_uclibc_dyn
-rwxr-xr-x 1 hinkok hinkok 6104 Aug 20 14:52 _hello_cris_new_uclibc_dyn
hinkok at alala /work/hello $ /work/stage/buildroot/build_cris/staging_dir/usr/bin/cris-linux-uclibc-readelf -l _hello_cris_new_uclibc_dyn
Elf file type is EXEC (Executable file)
Entry point 0x80344
There are 5 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000034 0x00080034 0x00080034 0x000a0 0x000a0 R E 0x4
INTERP 0x0000d4 0x000800d4 0x000800d4 0x00014 0x00014 R 0x1
[Requesting program interpreter: /lib/ld-uClibc.so.0]
LOAD 0x000000 0x00080000 0x00080000 0x0058c 0x0058c R E 0x2000
LOAD 0x00058c 0x0008258c 0x0008258c 0x000f0 0x00114 RW 0x2000
DYNAMIC 0x0005a0 0x000825a0 0x000825a0 0x000b8 0x000b8 RW 0x4
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .interp .hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.plt .init .plt .text .fini .rodata .eh_frame
03 .ctors .dtors .jcr .dynamic .got .data .bss
04 .dynamic
Why is size of the binary so much bigger with 0.9.29? Almost 3 times! And it does not get better if the binary is stripped - still approximately 3 times larger binary. The only difference I can see is LOAD section that is significantly larger in newer uClibc. Does this apply to /lib/ld-uClibc.so.0?
I've appended both uClibc config files for comparison, but I think they are pretty much the same.
Thank you,
Hinko
--
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: hinko.kocevar at cetrtapot.si
Http: www.cetrtapot.si
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: uclibc-0.9.27.config
Url: http://lists.busybox.net/pipermail/uclibc/attachments/20080820/558069cf/attachment.diff
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: uclibc-0.9.29.config
Url: http://lists.busybox.net/pipermail/uclibc/attachments/20080820/558069cf/attachment-0001.diff
More information about the uClibc
mailing list