From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7939 invoked by alias); 15 Oct 2002 12:09:56 -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 7931 invoked from network); 15 Oct 2002 12:09:54 -0000 Received: from unknown (HELO skynet.stack.nl) (131.155.140.225) by sources.redhat.com with SMTP; 15 Oct 2002 12:09:54 -0000 Received: from turtle.stack.nl (turtle.stack.nl [2001:610:1108:5010:202:b3ff:fe17:a070]) by skynet.stack.nl (Postfix) with ESMTP id EFAB0405C for ; Tue, 15 Oct 2002 14:10:02 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1663) id BF1F72E; Tue, 15 Oct 2002 14:09:53 +0200 (CEST) Date: Tue, 15 Oct 2002 05:09:00 -0000 From: Michiel Buddingh' To: gcc-help@gcc.gnu.org Subject: Re: Giant executables.. what am I doing wrong? Message-ID: <20021015120953.GA42231@stack.nl> References: <20021014234939.GA35014@stack.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-SW-Source: 2002-10/txt/msg00187.txt.bz2 On Tue, Oct 15, 2002 at 06:58:12AM -0400, Steve Dondley wrote: > > I'm currently trying to write a program for a linux system with limited > > memory, and as such I'd like gcc to generate small, statically linked > > executables. > > As someone new to C, I'm a little confused by the above. > According to GNU C tutorial I'm reading, using static > libraries INCREASES the amount of memory used. And for a normal system, that is correct. On a normal desktop or server system, many processes will run at the same time. If a number of those processes make use of the printf() function at one point in time, it makes sense to share the function between those processes. However, the system I'm building will probably run 3 or 4 processes on average, each of which will use only a small subset of the c library. As I'm limited in memory, I simply can't afford the (otherwise perfectly acceptable) overhead shared libraries impose. -- -- Michiel