path: root/docs/ld.lld.1
diff options
authorDimitry Andric <dim@FreeBSD.org>2019-01-19 10:05:49 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-01-19 10:05:49 +0000
commite2fd426bdafe9f5c10066d3926ece6e342184a67 (patch)
treebfbbb5fd38554e6b8988b7a217e9fd0623728d7d /docs/ld.lld.1
parent84c4061b34e048f47e5eb4fbabc1558495e8157c (diff)
Vendor import of lld trunk r351319 (just before the release_80 branchvendor/lld/lld-trunk-r351319
Notes: svn path=/vendor/lld/dist/; revision=343179 svn path=/vendor/lld/lld-trunk-r351319/; revision=343180; tag=vendor/lld/lld-trunk-r351319
Diffstat (limited to 'docs/ld.lld.1')
1 files changed, 51 insertions, 4 deletions
diff --git a/docs/ld.lld.1 b/docs/ld.lld.1
index 0fdfe0ae7e89..d1ce4a3517f4 100644
--- a/docs/ld.lld.1
+++ b/docs/ld.lld.1
@@ -3,7 +3,7 @@
.\" This man page documents only lld's ELF linking support, obtained originally
.\" from FreeBSD.
-.Dd July 30, 2018
+.Dd September 26, 2018
.Dt LD.LLD 1
@@ -13,6 +13,7 @@
.Nm ld.lld
.Op Ar options
.Ar objfile ...
A linker takes one or more object, archive, and library files, and combines
them into an output file (an executable, a shared library, or another object
@@ -25,7 +26,21 @@ is a drop-in replacement for the GNU BFD and gold linkers.
It accepts most of the same command line arguments and linker scripts
as GNU linkers.
-These options are available:
+currently supports i386, x86-64, ARM, AArch64, PowerPC32, PowerPC64,
+MIPS32, MIPS64, RISC-V, AMDGPU, Hexagon and SPARC V9 targets.
+acts as a Microsoft link.exe-compatible linker if invoked as
+.Nm lld-link
+and as macOS's ld if invoked as
+.Nm ld.ld64.
+All these targets are always supported however
+was built, so you can always use
+as a native linker as well as a cross linker.
.Bl -tag -width indent
.It Fl -allow-multiple-definition
Do not error if a symbol is defined multiple times.
@@ -144,6 +159,9 @@ Maximum number of errors to emit before stopping.
A value of zero indicates that there is no limit.
.It Fl -error-unresolved-symbols
Report unresolved symbols as errors.
+.It Fl -execute-only
+Mark executable sections unreadable. This option is currently only
+supported on AArch64.
.It Fl -exclude-libs Ns = Ns Ar value
Exclude static libraries from automatic export.
.It Fl -export-dynamic , Fl E
@@ -297,6 +315,8 @@ Include hotness information in the optimization remarks file.
Create a position independent executable.
.It Fl -print-gc-sections
List removed unused sections.
+.It Fl -print-icf-sections
+List identical folded sections.
.It Fl -print-map
Print a link map to the standard output.
.It Fl -push-state
@@ -304,7 +324,7 @@ Save the current state of
.Fl -as-needed ,
.Fl -static ,
-.Fl -while-archive.
+.Fl -whole-archive.
.It Fl -pop-state
Undo the effect of
.Fl -push-state.
@@ -426,6 +446,17 @@ This can be used to ensure linker invocation remains compatible with
traditional Unix-like linkers.
.It Fl -warn-common
Warn about duplicate common symbols.
+.It Fl -warn-ifunc-textrel
+Warn about using ifunc symbols in conjunction with text relocations.
+Older versions of glibc library (2.28 and earlier) has a bug that causes
+the segment that includes ifunc symbols to be marked as not executable when
+they are relocated. As a result, although the program compiles and links
+successfully, it gives segmentation fault when the instruction pointer reaches
+an ifunc symbol. Use -warn-ifunc-textrel to let lld give a warning, if the
+code may include ifunc symbols, may do text relocations and be linked with
+an older glibc version. Otherwise, there is no need to use it, as the default
+value does not give a warning. This flag has been introduced in late 2018,
+has no counter part in ld and gold linkers, and may be removed in the future.
.It Fl -warn-unresolved-symbols
Report unresolved symbols as warnings.
.It Fl -whole-archive
@@ -440,10 +471,22 @@ Make the main stack executable.
Stack permissions are recorded in the
+.It Cm global
+Sets the
+.Dv DF_1_GLOBAL flag in the
+Different loaders can decide how to handle this flag on their own.
.It Cm initfirst
Sets the
flag to indicate the module should be initialized first.
+.It Cm interpose
+Set the
+flag to indicate to the runtime linker that the object is an interposer.
+During symbol resolution interposers are searched after the application
+but before other dependencies.
.It Cm muldefs
Do not error if a symbol is defined multiple times.
The first definition will be used.
@@ -453,6 +496,10 @@ This is a synonym for
Disable combining and sorting multiple relocation sections.
.It Cm nocopyreloc
Disable the creation of copy relocations.
+.It Cm nodefaultlib
+Set the
+flag to indicate that default library search paths should be ignored.
.It Cm nodelete
Set the
@@ -460,7 +507,7 @@ flag to indicate that the object cannot be unloaded from a process.
.It Cm nodlopen
Set the
-flag to indcate that the object may not be opened by
+flag to indicate that the object may not be opened by
.Xr dlopen 3 .
.It Cm norelro
Do not indicate that portions of the object shold be mapped read-only