Re: ld -static option.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux