From owner-freebsd-current Wed Sep 25 23:10:22 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id XAA09761 for current-outgoing; Wed, 25 Sep 1996 23:10:22 -0700 (PDT) Received: from alpo.whistle.com (s205m1.whistle.com [207.76.205.1]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id XAA09706 for ; Wed, 25 Sep 1996 23:10:17 -0700 (PDT) Received: from current1.whistle.com (current1.whistle.com [207.76.205.22]) by alpo.whistle.com (8.7.5/8.7.3) with SMTP id XAA15163 for ; Wed, 25 Sep 1996 23:09:25 -0700 (PDT) Message-ID: <324A1DAE.41C67EA6@whistle.com> Date: Wed, 25 Sep 1996 23:07:42 -0700 From: Julian Elischer Organization: Whistle Communications X-Mailer: Mozilla 3.0b6 (X11; I; FreeBSD 2.2-CURRENT i386) MIME-Version: 1.0 To: current@freebsd.org Subject: BLOAT in minimal programs Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I wanted to write a minimal footprint program that would be as tiny as possible.. it seems impossible.. here is the symbol list for this statically linked program. it uses NO stdio functions. it assings a few integer variables calls a syscall and exits. It's over 38K long! 00001020 F /usr/lib/scrt0.o 00001020 T start 00001090 t ___gnu_compiled_c 00001090 t gcc2_compiled. 00001090 F thrashd.o 0000109c T _main 000010c0 T ___do_global_dtors IT'S NOT C++! 000010c0 F __main.o 000010e8 T ___do_global_ctors 00001134 T ___main 00001160 T _atexit 00001160 F _exit.o 00001160 F atexit.o 000011d0 F malloc.o 000012c4 T _malloc_dump 0000191c T _malloc_pages 00001e1c T _malloc 00001e90 T _free 0000224c T _realloc 00002410 T _mmap 00002410 F mmap.o 00002440 F brk.o 00002470 T __brk 00002474 T _brk 00002489 t ok 000024a7 t err 000024b0 F sbrk.o 000024e4 T _sbrk 0000250f t back 00002510 t err 00002520 F munmap.o 00002528 T _munmap 00002540 F memset.o 00002578 T _memset 000025c0 T ___findenv 000025c0 F getenv.o 00002650 T _getenv 000026e0 T _fprintf 000026e0 F fprintf.o 00002700 F vfprintf.o 00002a24 T _vfprintf 00004030 T ___sfvwrite 00004030 F fvwrite.o 000042d0 T ___umoddi3 000042d0 F umoddi3.o 00004300 T ___udivdi3 00004300 F udivdi3.o 00004320 T ___moddi3 00004320 F moddi3.o 000043a0 T ___divdi3 000043a0 F divdi3.o 00004420 F isinf.o 00004454 T _isnan 00004480 T _isinf 000044b0 F memmove.o 000044e8 T _memcpy 000044e8 T _memmove 00004540 F memchr.o 00004578 T _memchr 000045a0 T _abort 000045a0 F abort.o 00004600 T ___swsetup 00004600 F wsetup.o 000046a0 T ___smakebuf 000046a0 F makebuf.o 00004728 T ___swhatbuf 000047c0 F findfp.o 0000481c T ___sfp 000048c0 T _f_prealloc 000048f8 T __cleanup 00004908 T ___sinit 00004930 T _fflush 00004930 F fflush.o 00004968 T ___sflush 000049d0 F qdivrem.o 00004a40 T ___qdivrem 00004ec0 T _signal 00004ec0 F signal.o 00004f20 T _isatty 00004f20 F isatty.o 00004f40 F sigaction.o 00004f48 T _sigaction 00004f60 F kill.o 00004f68 T _kill 00004f80 F getpid.o 00004f88 T _getpid 00004fa0 F getdtablesize.o 00004fa8 T _getdtablesize 00004fc0 F fstat.o 00004fc8 T _fstat 00004fe0 F sigprocmask.o 00005019 t err 00005020 T _sigprocmask 00005053 t out 00005060 T _exit 00005060 F exit.o 000050a0 T ___sread 000050a0 F stdio.o 000050e0 T ___swrite 0000511c T ___sseek 00005168 T ___sclose 00005180 T __fwalk 00005180 F fwalk.o 000051d0 T _tcgetattr 000051d0 F termios.o 000051e8 T _tcsetattr 00005264 T _tcsetpgrp 00005284 T _tcgetpgrp 000052ac T _cfgetospeed 000052b8 T _cfgetispeed 000052c4 T _cfsetospeed 000052d4 T _cfsetispeed 000052e4 T _cfsetspeed 000052f8 T _cfmakeraw 0000532c T _tcsendbreak 0000538c T _tcdrain 000053a0 T _tcflush 0000540c T _tcflow 000054b0 T __exit 000054b0 F _exit.o 000054c0 F write.o 000054c8 T _write 000054e0 F select.o 000054e8 T _select 00005500 F read.o 00005508 T _read 00005520 F ioctl.o 00005528 T _ioctl 00005540 F close.o 00005548 T _close 00005560 T _lseek 00005560 F lseek.o 00005590 F __syscall.o 00005598 T ___syscall 000055b0 F cerror.o 000055e4 T cerror 00005600 F strtod.o 000060c8 T _strtod 00006e14 T ___dtoa 00007ba0 T ____runetype 00007ba0 F infinity.o 00007ba0 F runetype.o 00007bb0 T __none_init 00007bb0 F none.o 00007bb0 F table.o 00007bd8 T __none_sgetrune 00007c08 T __none_sputrune 00007c40 T _etext 00008000 D ___progname 00008010 D _interval 00008014 D _logfile 00008020 D __exit_dummy_ref 00008030 D __exit_dummy_decl 00008040 D minbrk 00008044 D curbrk 0000807c D ___sF 00008184 D ___sglue 000082c0 D ___infinity 000082d0 D __DefaultRuneLocale 00008f24 D __CurrentRuneLocale 00008f28 D ___mb_cur_max 00008f30 D _edata 00009684 B ___cleanup 00009688 B ___DTOR_LIST__ 00009690 B ___CTOR_LIST__ 00009698 B ___sdidinit 0000969c B _namebuf 0000979c B __sigintr 000097a0 B _linebuf 00009ba0 B ___atexit 00009ba4 B _environ 00009ba8 B _errno 00009bac B _direntbuf 0000bb54 B _end THIS IS NOT MINIMAL! I DID NOT WANT ALL THIS CRAP! why oh why did I get malloc? vfprintf? __CurrentRuneLocale ? hell it doesn't even contain a STRING let alone a default nationality! etc.etc. there has got to be a better way! about the only thing I want is errno and some syscalls. julian