From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7277 invoked by alias); 27 Jun 2006 06:18:08 -0000 Received: (qmail 7269 invoked by uid 22791); 27 Jun 2006 06:18:07 -0000 X-Spam-Check-By: sourceware.org Received: from mxout01.versatel.de (HELO mxout01.versatel.de) (212.7.152.117) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 27 Jun 2006 06:18:03 +0000 Received: from mx03.versatel.de (mx01.versatel.de [212.7.146.1]) by mxout01.versatel.de (8.12.11/8.12.11) with ESMTP id k5R6I0od018263 for ; Tue, 27 Jun 2006 08:18:00 +0200 Received: from ask.home.net (i53878540.versanet.de [83.135.133.64]) by mx03.versatel.de (8.12.11.20060308/8.12.11) with ESMTP id k5R6I0et004758 for ; Tue, 27 Jun 2006 08:18:00 +0200 Received: (qmail 5241 invoked from network); 27 Jun 2006 08:17:59 +0200 Received: from localhost (127.0.0.1) by localhost with SMTP; 27 Jun 2006 08:17:59 +0200 From: Ingo Krabbe To: gcc-help@gcc.gnu.org Subject: Re: Qn regarding building an application of smallest size for ARM-11 using gcc Date: Tue, 27 Jun 2006 06:18:00 -0000 User-Agent: KMail/1.9.3 Cc: Binesh References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606270817.59395.ikrabbe.ask@web.de> X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-06/txt/msg00230.txt.bz2 Am Dienstag, 27. Juni 2006 06:22 schrieb Binesh: > Hi, > > We are trying to build an application for ARM-11 using gcc and the > related auto make suite) that would occupy minimal size. > > After adding the -Os and -mthumb we noticed that the size of the > stripped executable with a dependency on libc.so and libz.so was about > 87K. > However, when we statically linked it the stripped size grew to 510 K. > We removed all code that uses any of string library or stdio and > instead use only system calls such as ioctl, read, write, mmap and > munmap. (verified using the symbol dumped out by readelf) > Despite this the size remains at 510K. > Trying to link with -nostdlib fails as it refers to undefined > reference to ioctl, read, write, mmap and munmap. > Trying to link with -nostartfiles brought down the size to only 502K. > > Do the sys call routines need std libs to be linked in? > Is there an alternative to reduce the size of the statically linked > exe? (Assuming that it might be difficult to migrate all code to asm) > > Would appreciate some help / guidance on this. In case there is > another forum/ list which would better annswer these question, please > fwd me to the same. > > Thanks! > -Binesh I think you have a libc.so problem. This means, you are using glibc, which really is no emebedded solution library. You should think about using smaller libraries that better fit you purpose. I found a nice page that lists some solutions: http://penguinppc.org/embedded/howto/library.html bye ingo