From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18295 invoked by alias); 15 Oct 2002 12:31:18 -0000 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 Received: (qmail 18271 invoked from network); 15 Oct 2002 12:31:16 -0000 Received: from unknown (HELO lizzard.sbs.de) (194.138.37.39) by sources.redhat.com with SMTP; 15 Oct 2002 12:31:16 -0000 Received: from mail.fth.sbs.de (mail.fth.sbs.de [192.129.41.35]) by lizzard.sbs.de (8.11.6/8.11.6) with ESMTP id g9FCVFo21352 for ; Tue, 15 Oct 2002 14:31:15 +0200 (MET DST) Received: from nsprim.swb.siemens.de (nsprim.swb.siemens.de [141.73.80.3]) by mail.fth.sbs.de (8.11.6/8.11.6) with ESMTP id g9FCVE827727 for ; Tue, 15 Oct 2002 14:31:14 +0200 (MET DST) Received: from fiji.swb.siemens.de (fiji.swb.siemens.de [141.73.80.26]) by nsprim.swb.siemens.de (8.9.1/8.9.1) with ESMTP id OAA28785 for ; Tue, 15 Oct 2002 14:31:13 +0200 (MET DST) Received: from localhost (localhost [127.0.0.1]) by fiji.swb.siemens.de (8.10.2+Sun/8.10.2) with SMTP id g9FCVCB25243 for ; Tue, 15 Oct 2002 14:31:13 +0200 (MEST) Message-Id: <200210151231.g9FCVCB25243@fiji.swb.siemens.de> Date: Tue, 15 Oct 2002 05:31:00 -0000 From: Ruppert Reply-To: Ruppert Subject: Re: Giant executables.. what am I doing wrong? To: gcc-help@gcc.gnu.org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: fNHIb3r4G1E7rfwfFAYnoA== X-SW-Source: 2002-10/txt/msg00193.txt.bz2 ... > If you run 'nm' on your pre-stripped executable you will see all the > compiled in functions from the C library and any other libraries. When you > do a static compile it doesn't just include only the needed function(s), but > the entire C library .a file. That's why I recommended going with a smaller > or more base-functionality C library such as newlib. > ... No. The linker will extract the modules from the archive file (.a) on a "per object" base. Thus if you use strcpy in your program the module which contains the definition of strcpy (usually strcpy.o) gets copied from the archive file to your executable. A archive file is, in fact, only a collection of individual objects pasted together and augmented by a common table of symbols. I would also recommend using 'nm'. This provides detailed insight into what constitutes your executable. -- D.Ruppert