82
The directories searched include several standard system directories plus any that you specify
with
.
-L
Normally the files found this way are library files--archive files whose members are object files.
The linker handles an archive file by scanning through it for members which define symbols that
have so far been referenced but not defined. But if the file that is found is an ordinary object file,
it is linked in the usual fashion. The only difference between using an
a file name is that
-lobjc
You need this special case of the
-nostartfiles
Do not use the standard system startup files when linking. The standard system libraries are used
normally, unless
-nodefaultlibs
Do not use the standard system libraries when linking. Only the libraries you specify will be
passed to the linker. The standard startup files are used normally, unless
used. The compiler may generate calls to memcmp, memset, and memcpy for System V (and
ISO C) environments or to bcopy and bzero for BSD environments. These entries are usually
resolved by entries in libc. These entry points should be supplied through some other mechanism
when this option is specified.
-nostdlib
Do not use the standard system startup files or libraries when linking. No startup files and only the
libraries you specify will be passed to the linker. The compiler may generate calls to memcmp,
memset, and memcpy for System V (and ISO C) environments or to bcopy and bzero for BSD
environments. These entries are usually resolved by entries in libc. These entry points should be
supplied through some other mechanism when this option is specified.
One of the standard libraries bypassed by
library of internal subroutines that GCC uses to overcome shortcomings of particular machines,
or special needs for some languages. (, for more discussion of
need
libgcc.a
specify
-nostdlib
sures that you have no unresolved references to internal GCC library subroutines. (For example,
, used to ensure C++ constructors will be called; .)
__main
-pie
Produce a position independent executable on targets which support it. For predictable results,
you must also specify the same set of options that were used to generate code (
or model suboptions) when you specify this option.
-s
Remove all symbol table and relocation information from the executable.
-static
On systems that support dynamic linking, this prevents linking with the shared libraries. On other
systems, this option has no effect.
-shared
Produce a shared object which can then be linked with other objects to form an executable. Not
all systems support this option. For predictable results, you must also specify the same set of
surrounds
-l
library
option in order to link an Objective-C program.
-l
or
-nostdlib
-nodefaultlibs
even when you want to avoid other standard libraries. In other words, when you
or
-nodefaultlibs
Chapter 4. GCC Command Options
with
and
and searches several directories.
lib
.a
is used.
and
-nostdlib
-nodefaultlibs
you should usually specify
option and specifying
-l
-nostartfiles
is
libgcc.a
.) In most cases, you
libgcc.a
as well. This en-
-lgcc
-fpie
is
, a
,
,
-fPIE
Need help?
Do you have a question about the ENTERPRISE LINUX 4 and is the answer not in the manual?
Questions and answers