public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <ian@wasabisystems.com>
To: "Bansidhar Arvind Deshpande - CTD,
	Chennai." <bansidhara@ctd.hcltech.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: ld -static option.
Date: Tue, 18 Nov 2003 13:25:00 -0000	[thread overview]
Message-ID: <m3ad6tlsgf.fsf@gossamer.airs.com> (raw)
In-Reply-To: <9F54AA5915501745A385AF7CBDC7E8716DA8AD@HARITHA.ctd.hcltech.com>

"Bansidhar Arvind Deshpande  - CTD, Chennai." <bansidhara@ctd.hcltech.com> 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

  reply	other threads:[~2003-11-18 13:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-18 11:05 Bansidhar Arvind Deshpande  - CTD, Chennai.
2003-11-18 13:25 ` Ian Lance Taylor [this message]
2003-11-18 18:26 lrtaylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3ad6tlsgf.fsf@gossamer.airs.com \
    --to=ian@wasabisystems.com \
    --cc=bansidhara@ctd.hcltech.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).