From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 25 Apr 2006 03:15:23 +0100 From: Derek Fawcus To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] impressive Message-ID: <20060425031523.N21356@mrwint.cisco.com> References: <444D3701.50303@lanl.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <444D3701.50303@lanl.gov>; from rminnich@lanl.gov on Mon, Apr 24, 2006 at 02:37:21PM -0600 Topicbox-Message-UUID: 452ac604-ead1-11e9-9d60-3106f5b1d025 On Mon, Apr 24, 2006 at 02:37:21PM -0600, Ronald G Minnich wrote: > This program: > > compiles to a 512KB binary on linux with -static glibc is bloated, printf and strtoul are also quite large. Try dietlibc ; diet gcc -c -Os testit.c ; size testit.o text data bss dec hex filename 289 0 0 289 121 testit.o ; diet gcc -o testit -s -Os testit.c ; size testit text data bss dec hex filename 9620 0 12 9632 25a0 testit So the libraries come to over 9k, and there is still some crud in the image: ; objdump -h testit testit: file format elf32-i386 Sections: Idx Name Size VMA LMA File off Algn 0 .text 00001548 080480a0 080480a0 000000a0 2**4 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .rodata 00000ff4 08049600 08049600 00001600 2**5 CONTENTS, ALLOC, LOAD, READONLY, DATA 2 .data 00000000 0804b5f4 0804b5f4 000025f4 2**2 CONTENTS, ALLOC, LOAD, DATA 3 .eh_frame 00000058 0804b5f4 0804b5f4 000025f4 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 .bss 0000000c 0804b650 0804b650 00002650 2**3 ALLOC 5 .comment 0000005d 00000000 00000000 00002650 2**0 CONTENTS, READONLY Why do I need an exception handler frame (assuming that is what the name means)? DF