LD.LLD(1)

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

DESCRIPTION
OVERVIEW: lld

USAGE: build-llvm/tools/clang/stage2-bins/bin/ld.lld [options] file...

  OPTIONS:

-(  Alias for --start-group

-)  Alias for --end-group

--allow-multiple-definition
    Allow multiple definitions

--allow-shlib-undefined Allow unresolved references in shared libraries (default when linking a shared library)

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

--dependent-libraries
    Process dependent library specifiers from input files (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=<file>
    Read a list of dynamic symbols. (executable) Put matched non-local definedsymbols to the dynamic symbol table. (shared object) References to matchednon-local STV_DEFAULT symbols shouldn't be bound to definitions within the shared object. Implies -Bsymbolic but does not set DF_SYMBOLIC

--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=glob
    (executable) Put matched symbols in the dynamic symbol table. (shared object) References to matched non-local STV_DEFAULT symbols shouldn't be bound to definitions within the shared object. Does not imply -Bsymbolic.

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

--fix-cortex-a8
    Apply fixes for ARM Cortex-A8 erratum 657417

--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-basicblock-sections=<value>
    Enable basic block sections for LTO

--lto-cs-profile-file=<value>
    Context sensitive profile file path

--lto-cs-profile-generate
    Perform context sensitive PGO instrumentation

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

--lto-emit-asm
    Emit assembly code

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

--lto-unique-bb-section-names
    Give unique names to every basic block section for LTO

--lto-whole-program-visibility
    Asserts that the LTO link has whole program visibility

-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

--mmap-output-file
    Mmap the output file for writing (default)

-M  Alias for --print-map

-m <value>
    Set target emulation

--nmagic
    Do not page align sections, link against static libraries.

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

--no-allow-shlib-undefined
    Do not allow unresolved references in shared libraries (default when linking an executable)

--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-dependent-libraries
    Ignore dependent library specifiers from input files

--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-lto-unique-bb-section-names
    Do not give unique names to every basic block section for LTO (default)

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

--no-mmap-output-file
    Do not mmap the output file for writing

--no-nmagic
    Page align sections (default)

--no-omagic
    Do not set the text data sections to be writable, page align sections (default)

--no-optimize-bb-jumps
    Do not remove any direct jumps at the end to the next basic block (default)

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

-n  Alias for --nmagic

--oformat <format>
    Specify the binary format for the output object file

--omagic
    Set the text and data sections to be readable and writable, do not page align sections, link against static libraries

--opt-remarks-filename <value>
    YAML output file for optimization remarks

--opt-remarks-format <value>
    The format used for serializing remarks (default: YAML)

--opt-remarks-passes <value>
    Regex for the passes that need to be serialized to the output file

--opt-remarks-with-hotness
    Include hotness information in the optimization remarks file

--optimize-bb-jumps
    Remove direct jumps at the end to the next basic block

--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=-<value>
    Specify an LLVM option for compatibility with LLVMgold.so

--plugin-opt=cs-profile-generate
    Alias for --lto-cs-profile-generate

--plugin-opt=cs-profile-path=<value>
    Alias for --lto-cs-profile-file

--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=emit-asm
    Alias for --lto-emit-asm

--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=obj-path=<value>
    Alias for --lto-obj-path=

--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=thinlto-emit-imports-files
    Alias for --thinlto-emit-imports-files

--plugin-opt=thinlto-index-only=<value>
    Alias for --thinlto-index-only=

--plugin-opt=thinlto-index-only
    Alias for --thinlto-index-only

--plugin-opt=thinlto-object-suffix-replace=<value>
    Alias for --thinlto-object-suffix-replace=

--plugin-opt=thinlto-prefix-replace=<value>
    Alias for --thinlto-prefix-replace=

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

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

--print-archive-stats=<value>
    Write archive usage statistics to the specified file. Print the numbers of members and fetched members for each archive

--print-gc-sections
    List removed unused sections

--print-icf-sections
    List identical folded sections

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

--print-symbol-order=<value>
    Print a symbol order specified by --call-graph-ordering-file into the specified file

--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>
    Write a tar file containing input files and command line options to reproduce link

--retain-symbols-file=<file>
    Retain only the symbols listed in the file

--rosegment
    Put read-only non-executable sections in their own segment (default)

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

--shuffle-sections=<seed>
    Shuffle input sections using the given seed. If 0, use a random seed

--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. Default to --threads=

--thinlto-single-module=<value>
    Specific a single module to compile in ThinLTO mode, for debugging only

--threads=<value>
    Number of threads. '1' disables multi-threading. By default all available hardware threads are used

--time-trace-file=<value>
    Specify time trace output file

--time-trace-granularity=<value>
    Minimum time granularity (in microseconds) traced by time profiler

--time-trace
    Record time trace

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

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

-T <value>
    Alias for --script

-t  Alias for --trace

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

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

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

--unique
    Creates a separate output section for every orphan input section

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

--vs-diagnostics
    Format diagnostics for Visual Studio compatibility

-V  Alias for --version

-v  Display the version number

--warn-backrefs-exclude=<glob>
    Glob describing an archive (or an object file within --start-lib) which should be ignored for --warn-backrefs.

--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/tools/clang/stage2-bins/bin/ld.lld: supported targets: elf