Skip to content

Instantly share code, notes, and snippets.

@croepha
Created December 12, 2017 18:11
Show Gist options
  • Save croepha/702a7eb914c911b967bdb63795ace4ef to your computer and use it in GitHub Desktop.
Save croepha/702a7eb914c911b967bdb63795ace4ef to your computer and use it in GitHub Desktop.
LD.LLD(1) User Commands LD.LLD(1)
NAME
ld.lld - manual page for ld.lld 5.0
DESCRIPTION
OVERVIEW: lld
USAGE: build-llvm/bin/ld.lld [options] <inputs>
OPTIONS:
--allow-multiple-definition
Allow multiple definitions
--as-needed
Only set DT_NEEDED for shared libraries if used
--auxiliary <value>
Set DT_AUXILIARY field to the specified name
--Bdynamic
Link against shared libraries
--Bstatic
Do not link against shared libraries
--Bsymbolic-functions
Bind defined function symbols locally
--Bsymbolic
Bind defined symbols locally
--build-id=<value>
Generate build ID note
--build-id
Generate build ID note
--color-diagnostics=<value>
Use colors in diagnostics
--color-diagnostics
Use colors in diagnostics
--compress-debug-sections=<value>
Compress DWARF debug sections
--define-common
Assign space to common symbols
--defsym=<value>
Define a symbol alias
--demangle
Demangle symbol names
--disable-new-dtags
Disable new dynamic tags
--discard-all
Delete all local symbols
--discard-locals
Delete temporary local symbols
--discard-none
Keep all symbols in the symbol table
--dynamic-linker <value>
Which dynamic linker to use
--dynamic-list <value>
Read a list of dynamic symbols
--eh-frame-hdr
Request creation of .eh_frame_hdr section and PT_GNU_EH_FRAME segment header
--emit-relocs
Generate relocations in output
--enable-new-dtags
Enable new dynamic tags
--end-lib
End a grouping of objects that should be treated as if they were together in an ar‐
chive
--entry <entry>
Name of entry point symbol
--error-limit <value>
Maximum number of errors to emit before stopping (0 = no limit)
--error-unresolved-symbols
Report unresolved symbols as errors
--exclude-libs <value>
Exclude static libraries from automatic export
--export-dynamic-symbol <value>
Put a symbol in the dynamic symbol table
--export-dynamic
Put symbols in the dynamic symbol table
--fatal-warnings
Treat warnings as errors
--filter=<value>
Set DT_FILTER field to the specified name
--fini <symbol>
Specify a finalizer function
--format=<input-format> Change the input format of the inputs following this option
--full-shutdown
Perform a full shutdown instead of calling _exit
--gc-sections
Enable garbage collection of unused sections
--gdb-index
Generate .gdb_index section
--hash-style <value>
Specify hash style (sysv, gnu or both)
--help Print option help
--icf=all
Enable identical code folding
--icf=none
Disable identical code folding
--image-base=<value>
Set the base address
--init <symbol>
Specify an initializer function
--lto-aa-pipeline=<value>
AA pipeline to run during LTO. Used in conjunction with -lto-newpm-passes
--lto-newpm-passes=<value>
Passes to run during LTO
--lto-O<opt-level>
Optimization level for LTO
--lto-partitions=<value>
Number of LTO codegen partitions
-L <dir>
Add a directory to the library search path
-l <libName>
Root name of library to use
--Map <value>
Print a link map to the specified file
-m <value>
Set target emulation
--no-as-needed
Always DT_NEEDED for shared libraries
--no-color-diagnostics
Do not use colors in diagnostics
--no-define-common
Do not assign space to common symbols
--no-demangle
Do not demangle symbol names
--no-dynamic-linker
Inhibit output of .interp section
--no-gc-sections
Disable garbage collection of unused sections
--no-gnu-unique
Disable STB_GNU_UNIQUE symbol binding
--no-rosegment
Do not put read-only non-executable sections in their own segment
--no-threads
Do not run the linker multi-threaded
--no-undefined-version
Report version scripts that refer undefined symbols
--no-undefined
Report unresolved symbols even if the linker is creating a shared library
--no-whole-archive
Restores the default behavior of loading archive members
--noinhibit-exec
Retain the executable output file whenever it is still usable
--nopie
Do not create a position independent executable
--nostdlib
Only search directories specified on the command line
--oformat <format>
Specify the binary format for the output object file
--omagic
Set the text and data sections to be readable and writable
--opt-remarks-filename <value>
YAML output file for optimization remarks
--opt-remarks-with-hotness
Include hotness informations in the optimization remarks file
-O<value>
Optimize output file size
-o <path>
Path to file to write output
--pie Create a position independent executable
--print-gc-sections
List removed unused sections
--print-map
Print a link map to the standard output
--relocatable
Create relocatable object file
--reproduce <value>
Dump linker invocation and input files for debugging
--retain-symbols-file=<file>
Retain only the symbols listed in the file
--rpath <value>
Add a DT_RUNPATH to the output
--rsp-quoting=<value>
Quoting style for response files. Values supported: windows|posix
--script <value>
Read linker script
--section-start <address>
Set address of section
--shared
Build a shared object
--soname=<value>
Set DT_SONAME
--sort-section <value>
Specifies sections sorting rule when linkerscript is used
--start-lib
Start a grouping of objects that should be treated as if they were together in an ar‐
chive
--strip-all
Strip all symbols
--strip-debug
Strip debugging information
--symbol-ordering-file <value>
Layout sections in the order specified by symbol file
--sysroot=<value>
Set the system root
--target1-abs
Interpret R_ARM_TARGET1 as R_ARM_ABS32
--target1-rel
Interpret R_ARM_TARGET1 as R_ARM_REL32
--target2=<type>
Interpret R_ARM_TARGET2 as <type>, where <type> is one of rel, abs, or got-rel
--Tbss <value>
Same as --section-start with .bss as the sectionname
--Tdata <value>
Same as --section-start with .data as the sectionname
--thinlto-cache-dir=<value>
Path to ThinLTO cached object file directory
--thinlto-cache-policy <value>
Pruning policy for the ThinLTO cache
--thinlto-jobs=<value>
Number of ThinLTO jobs
--threads
Run the linker multi-threaded
--trace-symbol <value>
Trace references to symbols
--trace
Print the names of the input files
--Ttext <value>
Same as --section-start with .text as the sectionname
--undefined <value>
Force undefined symbol during linking
--unresolved-symbols=<value>
Determine how to handle unresolved symbols
--verbose
Verbose mode
--version-script <value>
Read a version script
--version
Display the version number and exit
-v Display the version number
--warn-common
Warn about duplicate common symbols
--warn-unresolved-symbols
Report unresolved symbols as warnings
--whole-archive
Force load of all members in a static library
--wrap <symbol>
Use wrapper functions for symbol
-z <option>
Linker option extensions
build-llvm/bin/ld.lld: supported targets: elf32-i386 elf32-iamcu elf32-littlearm
elf32-ntradbigmips elf32-ntradlittlemips elf32-powerpc elf32-tradbigmips elf32-tradlit‐
tlemips elf32-x86-64 elf64-amdgpu elf64-littleaarch64 elf64-powerpc elf64-tradbigmips
elf64-tradlittlemips elf64-x86-64
SEE ALSO
The full documentation for ld.lld is maintained as a Texinfo manual. If the info and ld.lld
programs are properly installed at your site, the command
info ld.lld
should give you access to the complete manual.
ld.lld 5.0 November 2017 LD.LLD(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment