LD(1) AerieBSD 1.0 Refernce Manual LD(1)

NAME

ld — link editor

SYNOPSIS

ld [-iMnNOrsStvVxXZ] [--cref] [-AcCDeuy name] [-o a.out] ... file [-l lib] [-L path] [-R file] ...

DESCRIPTION

ld combines several object files into one program, resolves external references, and searches libraries.
-A name, -architecture name
Assume all input object files and subsequently the outout file format being for the architecture name.
-C name, -init name
Add name to the constructor list.
-c name, -fini name
Add name to the destructor list.
-D name=addr, -defsym name=addr
Define an absolute symbol name with a value addr.
-EB
Generate a big-endian output.
-EL
Generate a little-endian output.
-e name, -entry name
Assume symbol name to be the entry point. Default entry point name is “_start” on most architectures.
-i , r , --relocatable
Produce a relocatable output. .Il Fl L Y Ar path , Fl library-path Ar path Add path to the list of directories to be searched for libraries.
-l name, -library name
Search library named lib name.a for unresolved named and load correspondent object files in.
-M
Print executable map to the standard output.
-n , --nmagic
Prodice an NMAGIC output (see for more information).
-N , --omagic
Prodice an OMAGIC output (see for more information).
-o name, -output name
Set output file name to name instead of default a.out.
-R name, -just-symbols name
Only load symbols from the ile name.
-S , --strip-debug
Do not include debugging information in the output file.
-s , --strip-all
Do not include any symbolic information in the output file.
-t , --trace
Trace the file sas they are being loaded.
-u name, -undefined name
Enter symbol name as undefined into the global symbol table.
-V v
Print linker version.
-x , --discard-all
Discard all local symbols from the symbol table of the output file.
-X , --discard-locals
Discard only compiler's temporary and local symbols.
-y name, -trace-symbol name
Trace all files for this symbol.
-Z
Prodice an ZMAGIC output (see for more information).
--cref
Print a cross-reference table to the standard output.

FILES

/usr/lib/lib*
Libraries.
/usr/local/lib/lib*
More libraries.
a.out
Output file.

OUTPUT

The output file is named a.out by default and is composed of various number of sections.

SEE ALSO

ar(1), as(1), cc(1), nm(1), ranlib(1), a.out(5), elf(5)

HISTORY

The ld command first appeared in Version 6 AT&T UNIX.

This version was written by Michael Shalayeff ‹mickey@lucifier.net›.

CAVEATS

Current ld(1) version only supports elf(5) binaries.


AerieBSD 1.0 Reference Manual October 11 2010 LD(1)