ld
[options
]objfiles
Combine several objfiles
, in the specified order, into
a single executable object module (a.out by default).
ld is the link editor and is often invoked automatically by compiler
commands such as cc.
Force default behavior for static linking (generate an object file and list undefined references). Do not use with -r.
Ignore special processing for shared reference symbols (dynamic linking only); output becomes more efficient but less sharable.
mode
See description under cc.
In dynamic linking, bind a symbol to its local definition, not to its global definition.
Force the definition of common storage.
c
]Link dynamically (c
is y) or statically (c
in n);
dynamic linking is the default.
symbol
Set symbol
as the address of the output file's entry point.
In dynamic linking, create a shared object and allow undefined symbols.
name
Use name
as the shared object file to search for during
dynamic linking (default is UNIX object file).
name
Use name
as the pathname of the loader (interpreter) to write
into the program header.
Default is none (static) or /usr/lib/libc.so.1 (dynamic).
x
Search a library named libx
.so or libx
.a
(the placement of this option on the line affects when the library
is searched).
dir
Search directory dir
before standard search directories
(this option must precede -l).
List a memory profile for input/output sections.
mapfile
Invoke ld directives from mapfile
(-M messes up the output and is discouraged).
Put the data section immediately after the text section. (SVR3 only.)
Create output file as read-only.
file
Send the output to file
(default is a.out).
c
List version information about ld in the output
(c
= y, the default) or do not list (c
= n).
Allow output to be subject to another ld.
Remove symbol table and relocation entries.
Suppress warning about multiply-defined symbols of unequal size.
symbol
Enter symbol
in symbol table; useful when loading from an archive
library. symbol
must precede the library that defines it
(so -u must precede -l).
Print the version of ld.
dirlist
Specify a comma-separated list of directories to use in place of the default search directories (see also -L).
Specify nodefs to allow undefined symbols. The default, defs, treats undefined symbols as a fatal error. Use text to produce an error when there are nonwritable relocations.
Enter only external symbols in output.
Save all local symbols except those whose first letter is L.
sym
Indicate each file in which sym
appears, its type and whether
the file defines or references it.
Arrange the file to be loaded on demand from the resulting executable file.