LD.LLD(1)

NAME
ld.lld - manual page for ld.lld 8

DESCRIPTION
OVERVIEW: lld

USAGE: build-llvm/bin/ld.lld [options] file...

  OPTIONS:

-(  Alias for --start-group

-)  Alias for --end-group

--allow-multiple-definition
    Allow multiple definitions

--apply-dynamic-relocs
    Apply link-time values for dynamic relocations

--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 (default)

--Bshareable
    Alias for --shared

--Bstatic
    Do not link against shared libraries

--Bsymbolic-functions
    Bind defined function symbols locally

--Bsymbolic
    Bind defined symbols locally

--build-id=[fast,md5,sha1,uuid,0x<hexstring>]
    Generate build ID note

--build-id
    Alias for --build-id=fast

-b <value>
    Alias for --format

--call-graph-ordering-file=<value>
    Layout sections to optimize the given callgraph

--call-graph-profile-sort
    Reorder sections with call graph profile (default)

--call_shared
    Alias for --Bdynamic

--check-sections
    Check section addresses for overlaps (default)

--color-diagnostics=[auto,always,never]
    Use colors in diagnostics

--color-diagnostics
    Alias for --color-diagnostics=always

--compress-debug-sections=[none,zlib]
    Compress DWARF debug sections

--cref
    Output cross reference table

--dc
    Alias for --define-common

--define-common
    Assign space to common symbols

--defsym=<symbol>=<value>
    Define a symbol alias

--demangle
    Demangle symbol names (default)

--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

--dn
    Alias for --Bstatic

--dp
    Alias for --define-common

--dynamic-linker=<value>
    Which dynamic linker to use

--dynamic-list=<value>
    Read a list of dynamic symbols

--dy
    Alias for --Bdynamic

-d  Alias for --define-common

--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 (default)

--end-group
    Ignored for compatibility with GNU unless you pass --warn-backrefs

--end-lib
    End a grouping of objects that should be treated as if they were together in an archive

--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

--execute-only
    Mark executable sections unreadable

--export-dynamic-symbol=<value>
    Put a symbol in the dynamic symbol table

--export-dynamic
    Put symbols in the dynamic symbol table

-E  Alias for --export-dynamic

-e <value>
    Alias for --entry

--fatal-warnings
    Treat warnings as errors

--filter=<value>
    Set DT_FILTER field to the specified name

--fini=<symbol>
    Specify a finalizer function

--fix-cortex-a53-843419 Apply fixes for AArch64 Cortex-A53 erratum 843419

--format=[default,elf,binary]
    Change the input format of the inputs following this option

-F <value>
    Alias for --filter

-f <value>
    Alias for --auxiliary

--gc-sections
    Enable garbage collection of unused sections

--gdb-index
    Generate .gdb_index section

--gnu-unique
    Enable STB_GNU_UNIQUE symbol binding (default)

--hash-style=<value>
    Specify hash style (sysv, gnu or both)

--help
    Print option help

-h <value>
    Alias for --soname

--icf=all
    Enable identical code folding

--icf=none
    Disable identical code folding (default)

--icf=safe
    Enable safe identical code folding

--ignore-data-address-equality
    lld can break the address equality of data

--ignore-function-address-equality
    lld can break the address equality of functions

--image-base=<value>
    Set the base address

--init=<symbol>
    Specify an initializer function

--just-symbols=<value>
    Just link symbols

--keep-unique=<value>
    Do not fold this symbol during ICF

--library-path=<dir>
    Add a directory to the library search path

--library=<libName>
    Root name of library to use

--lto-aa-pipeline=<value>
    AA pipeline to run during LTO. Used in conjunction with -lto-newpm-passes

--lto-debug-pass-manager
    Debug new pass manager

--lto-new-pass-manager
    Use new pass manager

--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

--lto-sample-profile=<value>
    Sample profile file path

-L <value>
    Alias for --library-path

-l <value>
    Alias for --library

--Map=<value>
    Print a link map to the specified file

--merge-exidx-entries
    Enable merging .ARM.exidx entries (default)

--mllvm=<value>
    Additional arguments to forward to LLVM's option processing

-M  Alias for --print-map

-m <value>
    Set target emulation

--no-allow-multiple-definition
    Do not allow multiple definitions (default)

--no-apply-dynamic-relocs
    Do not apply link-time values for dynamic relocations (default)

--no-as-needed
    Always set DT_NEEDED for shared libraries (default)

--no-call-graph-profile-sort
    Do not reorder sections with call graph profile

--no-check-sections
    Do not check section addresses for overlaps

--no-color-diagnostics
    Do not use colors in diagnostics

--no-cref
    Do not output cross reference table

--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-eh-frame-hdr
    Do not create .eh_frame_hdr section

--no-execute-only
    Mark executable sections readable (default)

--no-export-dynamic
    Do not put symbols in the dynamic symbol table (default)

--no-fatal-warnings
    Do not treat warnings as errors (default)

--no-gc-sections
    Disable garbage collection of unused sections (default)

--no-gdb-index
    Do not generate .gdb_index section (default)

--no-gnu-unique
    Disable STB_GNU_UNIQUE symbol binding

--no-merge-exidx-entries
    Disable merging .ARM.exidx entries

--no-omagic
    Do not set the text data sections to be writable

--no-pic-executable
    Alias for --no-pie

--no-pie
    Do not create a position independent executable (default)

--no-print-gc-sections
    Do not list removed unused sections (default)

--no-print-icf-sections Do not list identical folded sections (default)

--no-rosegment
    Do not put read-only non-executable sections in their own segment

--no-threads
    Do not run the linker multi-threaded

--no-toc-optimize
    (PowerPC64) Disable TOC related optimizations

--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-use-android-relr-tags
    Use SHT_RELR / DT_RELR* tags (default)

--no-warn-backrefs
    Do not warn about backward symbol references to fetch archive members (default)

--no-warn-common
    Do not warn about duplicate common symbols (default)

--no-warn-ifunc-textrel Do not warn about using ifunc symbols with text relocations (default)

--no-warn-symbol-ordering
    Do not warn about problems with the symbol ordering file

--no-whole-archive
    Do not force load of all members in a static library (default)

--noinhibit-exec
    Retain the executable output file whenever it is still usable

--non_shared
    Alias for --Bstatic

--nostdlib
    Only search directories specified on the command line

-N  Alias for --omagic

--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 information in the optimization remarks file

--orphan-handling=<value>
    Control how orphan sections are handled when linker script used

--output=<value>
    Alias for -o

--output <value>
    Alias for -o

-O <value>
    Optimize output file size

-o <path>
    Path to file to write output

--pack-dyn-relocs=[none,android,relr,android+relr]
    Pack dynamic relocations in the given format

--pic-executable
    Alias for --pie

--pic-veneer
    Always generate position independent thunks (veneers)

--pie
    Create a position independent executable

--plugin-opt=debug-pass-manager
    Alias for -lto-debug-pass-manager

--plugin-opt=disable-verify
    Alias for -disable-verify

--plugin-opt=dwo_dir=<value>
    Directory to store .dwo files when LTO and debug fission are used

--plugin-opt=jobs=<value>
    Alias for -thinlto-jobs

--plugin-opt=lto-partitions=<value>
    Alias for -lto-partitions

--plugin-opt=new-pass-manager
    Alias for -lto-new-pass-manager

--plugin-opt=O<value>
    Alias for -lto-O

--plugin-opt=sample-profile=<value>
    Alias for -lto-sample-profile

--plugin-opt=save-temps Alias for -save-temps

--plugin-opt=<value>
    specifies LTO options for compatibility with GNU linkers

--plugin=<value>
    Ignored for compatibility with GNU linkers

--pop-state
    Undo the effect of -push-state

--print-gc-sections
    List removed unused sections

--print-icf-sections
    List identical folded sections

--print-map
    Print a link map to the standard output

--push-state
    Save the current state of -as-needed, -static and -whole-archive

-q  Alias for --emit-relocs

--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=[posix,windows]
    Quoting style for response files

-R <value>
    Alias for --rpath

-r  Alias for --relocatable

--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

--split-stack-adjust-size=<value>
    Specify adjustment to stack size when a split-stack function calls a non-split-stack function

--start-group
    Ignored for compatibility with GNU unless you pass --warn-backrefs

--start-lib
    Start a grouping of objects that should be treated as if they were together in an archive

--static
    Alias for --Bstatic

--strip-all
    Strip all symbols

--strip-debug
    Strip debugging information

--symbol-ordering-file=<value>
    Layout sections to place symbols in the order specified by symbol ordering file

--sysroot=<value>
    Set the system root

-S  Alias for --strip-debug

-s  Alias for --strip-all

--target1-abs
    Interpret R_ARM_TARGET1 as R_ARM_ABS32 (default)

--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 (default)

--toc-optimize
    (PowerPC64) Enable TOC related optimizations (default)

--trace-symbol=<value>
    Trace references to symbols

--trace
    Print the names of the input files

-Ttext-segment=<value>
    Alias for --Ttext

-Ttext-segment <value>
    Alias for --Ttext

--Ttext=<value>
    Same as --section-start with .text as the sectionname

-T <value>
    Alias for --script

-t  Alias for --trace

--undefined-version
    Allow unused version in version script (default)

--undefined=<symbol>
    Force undefined symbol during linking

--unresolved-symbols=<value>
    Determine how to handle unresolved symbols

--use-android-relr-tags Use SHT_ANDROID_RELR / DT_ANDROID_RELR* tags instead of SHT_RELR / DT_RELR*

-u <value>
    Alias for --undefined

--verbose
    Verbose mode

--version-script=<value>
    Read a version script

--version
    Display the version number and exit

-V  Alias for --version

-v  Display the version number

--warn-backrefs
    Warn about backward symbol references to fetch archive members

--warn-common
    Warn about duplicate common symbols

--warn-ifunc-textrel
    Warn about using ifunc symbols with text relocations

--warn-symbol-ordering
    Warn about problems with the symbol ordering file (default)

--warn-unresolved-symbols
    Report unresolved symbols as warnings

--whole-archive
    Force load of all members in a static library

--wrap=<symbol>=<symbol>
    Use wrapper functions for symbol

-X  Alias for --discard-locals

-x  Alias for --discard-all

-y <value>
    Alias for --trace-symbol

-z <option>
    Linker option extensions

build-llvm/bin/ld.lld: supported targets: elf