From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23992 invoked by alias); 18 Nov 2003 13:25:12 -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 23985 invoked from network); 18 Nov 2003 13:25:11 -0000 Received: from unknown (HELO yosemite.airs.com) (209.128.65.135) by sources.redhat.com with SMTP; 18 Nov 2003 13:25:11 -0000 Received: (qmail 23412 invoked by uid 10); 18 Nov 2003 13:25:10 -0000 Received: (qmail 14204 invoked by uid 500); 18 Nov 2003 13:25:04 -0000 From: Ian Lance Taylor To: "Bansidhar Arvind Deshpande - CTD, Chennai." Cc: gcc-help@gcc.gnu.org Subject: Re: ld -static option. References: <9F54AA5915501745A385AF7CBDC7E8716DA8AD@HARITHA.ctd.hcltech.com> Date: Tue, 18 Nov 2003 13:25:00 -0000 In-Reply-To: <9F54AA5915501745A385AF7CBDC7E8716DA8AD@HARITHA.ctd.hcltech.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-11/txt/msg00246.txt.bz2 "Bansidhar Arvind Deshpande - CTD, Chennai." writes: > I am using gcc 2.96. I am wondering the working of -static option given for > ld. What is the exact functionality of this. > e.g > ld a.o -static -L./ -lmylib -o a.out > > In above example does the -static option apply only for mylib which is > specified > by -l or it is applied for all of the libraries to generated a.out. > Generically > does -static controls only to the libraries specified by -l or all of the > libraries > taken by ld to generate the executable ? The description of linker options may be found here: http://sources.redhat.com/binutils/docs-2.12/ld.info/Options.html#Options The description of -static says this: Do not link against shared libraries. This is only meaningful on platforms for which shared libraries are supported. The different variants of this option are for compatibility with various systems. You may use this option multiple times on the command line: it affects library searching for -l options which follow it. I believe that answers your question. > I am also interested in hidden functionality of -static if exists. I don't understand this question. Ian