-Wl,option
Pass option
as an option to the linker. If
option
contains commas, it is split into multiple
options at the commas. You can use this syntax to pass an argument to
the option. For example, `-Wl,-Map,output.map' passes `-Map
output.map' to the linker.
-Wl, -nostartfiles
Do not use the standard system startup files when linking.
The standard system libraries are used normally, unless -nostdlib
or
-nodefaultlibs
is used.
-Wl,-nodefault
Do not use the standard system libraries when linking.
Only the libraries you specify will be passed to the linker, options specifying
linkage of the system libraries, such as -static-libgcc
or
-shared-libgcc
, will be ignored. The standard start-up files are
normally used, unless -nostartfiles
is used. The compiler may
generate calls to memcmp
, memset
,
memcpy
, and memmove
. These entries are usually
resolved by entries in libc. These entry points should be supplied through some other
mechanism when this option is specified.
-Wl,-nostdlib
Do not use the standard system start-up files or libraries when linking.
One of the standard libraries bypassed by
-nostdlib
and -nodefaultlibs
is
libgcc.a
, a library of internal subroutines that GCC uses to
overcome shortcomings of particular machines, or special needs for some languages. In
most cases, you need libgcc.a even when you want to avoid other standard libraries.
In other words, when you specify -nostdlib
or
-nodefaultlibs
you should usually specify -lgcc as well. This
ensures that you have no unresolved references to internal GCC library
subroutines.
-Wl,-s
Remove all symbol table and relocation information from the executable.
-Wl,-static
On systems that support dynamic linking, this prevents linking with the shared libraries. On other systems, this option has no effect.