OVERVIEW: lld USAGE: /usr/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) --android-memtag-heap Instruct the dynamic loader to enable MTE protection for the heap --android-memtag-mode= Instruct the dynamic loader to start under MTE mode {async, sync, none} --android-memtag-stack Instruct the dynamic loader to prepare for MTE stack instrumentation --apply-dynamic-relocs Apply link-time values for dynamic relocations --as-needed Only set DT_NEEDED for shared libraries if used --auxiliary= Set DT_AUXILIARY field to the specified name --Bdynamic Link against shared libraries (default) --be8 write a Big Endian ELF file using BE8 format (AArch32 only) --Bno-symbolic Don't bind default visibility defined symbols locally for -shared (default) --bp-compression-sort-startup-functions When --irpgo-profile is specified, prioritize function similarity for compression in addition to startup time --bp-compression-sort=[none,function,data,both] Improve Lempel-Ziv compression by grouping similar sections together, resulting in a smaller compressed app size --bp-startup-sort=[none,function] Utilize a temporal profile file to reduce page faults during program startup --branch-to-branch Enable branch-to-branch optimization (default at -O2) --Bshareable Alias for --shared --Bstatic Do not link against shared libraries --Bsymbolic-functions Bind default visibility defined function symbols locally for -shared --Bsymbolic-non-weak-functions Bind default visibility defined STB_GLOBAL function symbols locally for -shared --Bsymbolic-non-weak Bind default visibility defined STB_GLOBAL symbols locally for -shared --Bsymbolic Bind default visibility defined symbols locally for -shared --build-id=[fast,md5,sha1,uuid,0x] Generate build ID note --build-id Alias for --build-id=sha1 -b Alias for --format --call-graph-ordering-file= Layout sections to optimize the given callgraph --call-graph-profile-sort=[none,hfsort,cdsort] Reorder input sections with call graph profile using the specified algorithm (default: cdsort) --call_shared Alias for --Bdynamic --check-sections Check section addresses for overlaps (default) --cmse-implib Make the output library to be a CMSE secure code import library --color-diagnostics=[auto,always,never] Use colors in diagnostics (default: auto) --color-diagnostics Alias for --color-diagnostics=always --compress-debug-sections=[none,zlib,zstd] Compress DWARF debug sections --compress-sections=={none,zlib,zstd}[:level] Compress output sections that match the glob and do not have the SHF_ALLOC flag. The sections remain uncompressed if compressed content would be larger. The compression level is (if specified) or a default speed-focused level --cref Output cross reference table. If -Map is specified, print to the map file --debug-names Generate a merged .debug_names section --default-script= In the absence of --script, read this default linker script --defsym== Define a symbol alias --demangle Demangle symbol names (default) --dependency-file= Write a dependency file --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 -dT Alias for --default-script --dynamic-linker= Which dynamic linker to use --dynamic-list= Similar to --export-dynamic-symbol-list. When creating a shared object, this additionally implies -Bsymbolic but does not set DF_SYMBOLIC --dy Alias for --Bdynamic --EB Select the big-endian format in OUTPUT_FORMAT --eh-frame-hdr Request creation of .eh_frame_hdr section and PT_GNU_EH_FRAME segment header --EL Select the little-endian format in OUTPUT_FORMAT --emit-relocs Generate relocations in output --enable-new-dtags Enable new dynamic tags (default) --enable-non-contiguous-regions Spill input sections to later matching output sections to avoid memory region overflow --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= Name of entry point symbol --error-handling-script= Specify an error handling script --error-limit= Maximum number of errors to emit before stopping (0 = no limit) --error-unresolved-symbols Report unresolved symbols as errors --exclude-libs= Exclude static libraries from automatic export --execute-only Mark executable sections unreadable --export-dynamic-symbol-list=file Read a list of dynamic symbol patterns. Apply --export-dynamic-symbol on each pattern --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 Alias for --entry --fat-lto-objects Use the .llvm.lto section, which contains LLVM bitcode, in fat LTO object files to perform LTO. --fatal-warnings Treat warnings as errors --filter= Set DT_FILTER field to the specified name --fini= 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 --force-group-allocation Only meaningful for -r. Section groups are discarded. If two section group members are placed to the same output section, combine their relocations as well --format=[default,elf,binary] Change the input format of the inputs following this option --fortran-common Search archive members for definitions to override COMMON symbols (default) -F Alias for --filter -f 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= Specify hash style (sysv, gnu or both) --help Print option help -h 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= Set the base address --in-implib= Read an existing CMSE secure code import library and preserve entry function addresses in the resulting new CMSE secure code import library (optional when creating a CMSE secure image) --init= Specify an initializer function --irpgo-profile= Read a temporary profile file for use with --bp-startup-sort= --just-symbols= Just link symbols --keep-unique= Do not fold this symbol during ICF --library-path= Add to the library search path --library-path Add to the library search path --library= Search for library --library Search for library --load-pass-plugin= Load passes from plugin library --lto-aa-pipeline= AA pipeline to run during LTO. Used in conjunction with -lto-newpm-passes --lto-basic-block-address-map Emit basic block address map for LTO --lto-basic-block-sections= Enable basic block sections for LTO --lto-CGO Codegen optimization level for LTO --lto-cs-profile-file= 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-emit-llvm Emit LLVM-IR bitcode --lto-known-safe-vtables= When --lto-validate-all-vtables-have-type-infos is enabled, skip validation on these vtables (_ZTV symbols) --lto-newpm-passes= Passes to run during LTO --lto-O Optimization level for LTO --lto-partitions= Number of LTO codegen partitions --lto-pgo-warn-mismatch turn on warnings about profile cfg mismatch (default) --lto-sample-profile= Sample profile file path --lto-unique-basic-block-section-names Give unique names to every basic block section for LTO --lto-validate-all-vtables-have-type-infos Validate that all vtables have type infos for LTO link --lto-whole-program-visibility Asserts that the LTO link has whole program visibility --lto=[full,thin] Set LTO backend -L Add to the library search path -l Search for library --Map= Print a link map to the specified file --merge-exidx-entries Enable merging .ARM.exidx entries (default) --mllvm= 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 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-branch-to-branch Disable branch-to-branch optimization (default at -O0 and -O1) --no-check-sections Do not check section addresses for overlaps --no-color-diagnostics Alias for --color-diagnostics=never --no-debug-names Do not generate a merged .debug_names section (default) --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-fat-lto-objects Ignore the .llvm.lto section in relocatable object files (default). --no-fatal-warnings Do not treat warnings as errors (default) --no-fortran-common Do not search archive members for definitions to override COMMON symbols --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-basic-block-address-map Do not emit basic block address map for LTO (default) --no-lto-pgo-warn-mismatch turn off warnings about profile cfg mismatch --no-lto-unique-basic-block-section-names Do not give unique names to every basic block section for LTO (default) --no-lto-validate-all-vtables-have-type-infos Do not validate that all vtables have type infos for LTO link --no-lto-whole-program-visibility Asserts that the LTO link does not have whole program visibility --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-pcrel-optimize (PowerPC64) Disable PC-relative optimizations --no-pie Do not create a position independent executable (default) --no-power10-stubs Alias for --power10-stubs=no --no-print-gc-sections Do not list removed unused sections (default) --no-print-icf-sections Do not list identical folded sections (default) --no-relax-gp Disable global pointer relaxation (default) --no-relax Disable target-specific relaxations --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 extract 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-mismatch Suppress errors for certain unknown section types --no-warn-symbol-ordering Do not warn about problems with the symbol ordering file --no-warnings Suppress warnings and cancel --fatal-warnings --no-whole-archive Do not force load of all members in a static library (default) --no-xosegment Do not put execute-only sections in their own segment (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=[elf,binary] 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 YAML output file for optimization remarks --opt-remarks-format The format used for serializing remarks (default: YAML) --opt-remarks-hotness-threshold= Minimum profile count required for an optimization remark to be output. Use 'auto' to apply the threshold from profile summary. --opt-remarks-passes 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= Control how orphan sections are handled when linker script used --out-implib= Output the CMSE secure code import library to (required when creating a CMSE secure image) --output= Alias for -o --output Alias for -o -O Optimize output file size -o Path to file to write output --pack-dyn-relocs=[none,android,relr,android+relr] Pack dynamic relocations in the given format --package-metadata= Emit a percent-encoded string to the .note.package section --pcrel-optimize (PowerPC64) Enable PC-relative optimizations (default) --pic-executable Alias for --pie --pic-veneer Always generate position independent thunks (veneers) --pie Create a position independent executable --plugin-opt=- 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= 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= Directory to store .dwo files when LTO and debug fission are used --plugin-opt=emit-asm Alias for --lto-emit-asm --plugin-opt=emit-llvm Alias for --lto-emit-llvm --plugin-opt=jobs= Alias for --thinlto-jobs= --plugin-opt=lto-partitions= Alias for --lto-partitions --plugin-opt=obj-path= Alias for --lto-obj-path= --plugin-opt=opt-remarks-filename= Alias for --opt-remarks-filename --plugin-opt=opt-remarks-format= Alias for --opt-remarks-format --plugin-opt=opt-remarks-hotness-threshold= Alias for --opt-remarks-hotness-threshold --plugin-opt=opt-remarks-passes= Alias for --opt-remarks-passes --plugin-opt=opt-remarks-with-hotness Alias for --opt-remarks-with-hotness --plugin-opt=O Alias for --lto-O --plugin-opt=sample-profile= Alias for --lto-sample-profile --plugin-opt=save-temps Alias for --save-temps --plugin-opt=stats-file= Filename to write LTO statistics to --plugin-opt=thinlto-emit-imports-files Alias for --thinlto-emit-imports-files --plugin-opt=thinlto-index-only= Alias for --thinlto-index-only= --plugin-opt=thinlto-index-only Alias for --thinlto-index-only --plugin-opt=thinlto-object-suffix-replace= Alias for --thinlto-object-suffix-replace= --plugin-opt=thinlto-prefix-replace= Alias for --thinlto-prefix-replace= --plugin-opt=time-trace= Alias for --time-trace= --plugin= Ignored for compatibility with GNU linkers --pop-state Restore the states saved by --push-state --power10-stubs= Whether to use Power10 instructions in call stubs for R_PPC64_REL24_NOTOC and TOC/NOTOC interworking (yes (default): use; no: don't use). "auto" is currently the same as "yes" --power10-stubs Alias for --power10-stubs=auto --print-archive-stats= Write archive usage statistics to the specified file. Print the numbers of members and extracted members for each archive --print-gc-sections= List removed unused sections to --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-memory-usage Report target memory usage --print-symbol-order= 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 --randomize-section-padding= Randomly insert padding between input sections and at the start of each segment using given seed --relax-gp Enable global pointer relaxation --relax Enable target-specific relaxations if supported (default) --relocatable Create relocatable object file --remap-inputs-file= Each line contains 'from-glob=to-file'. An input file matching is remapped to --remap-inputs== Remap input files matching to --reproduce= Write tar file containing inputs and command to reproduce link --retain-symbols-file= Retain only the symbols listed in the file --rosegment Put read-only non-executable sections in their own segment (default) --rpath= Add a DT_RUNPATH to the output --rsp-quoting=[posix,windows] Quoting style for response files -R Alias for --rpath -r Alias for --relocatable --save-temps= Save select intermediate LTO compilation results --save-temps Save intermediate LTO compilation results --script= Read linker script --section-start=
Set address of section --shared Build a shared object --shuffle-sections== Shuffle matched sections using the given seed before mapping them to the output sections. If -1, reverse the section order. If 0, use a random seed --soname= Set DT_SONAME --sort-section= Specifies sections sorting rule when linkerscript is used --split-stack-adjust-size= 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. Implies --strip-debug --strip-debug Strip debugging information --symbol-ordering-file= Layout sections to place symbols in the order specified by symbol ordering file --sysroot= 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= Interpret R_ARM_TARGET2 as , where is one of rel, abs, or got-rel --Tbss= Same as --section-start with .bss as the sectionname --Tdata= Same as --section-start with .data as the sectionname --thinlto-cache-dir= Path to ThinLTO cached object file directory --thinlto-cache-policy= Pruning policy for the ThinLTO cache --thinlto-distributor-arg= Arguments to pass to the ThinLTO distributor --thinlto-distributor= Distributor to use for ThinLTO backend compilations. If specified, ThinLTO backend compilations will be distributed --thinlto-jobs= Number of ThinLTO jobs. Default to --threads= --thinlto-remote-compiler-arg= Compiler arguments for the ThinLTO distributor to pass for ThinLTO backend compilations --thinlto-remote-compiler-prepend-arg= Compiler prepend arguments for the ThinLTO distributor to pass for ThinLTO backend compilations --thinlto-remote-compiler= Compiler for the ThinLTO distributor to invoke for ThinLTO backend compilations --thinlto-single-module= Specify a single module to compile in ThinLTO mode, for debugging only --threads= Number of threads. '1' disables multi-threading. By default all available hardware threads are used --time-trace-granularity= Minimum time granularity (in microseconds) traced by time profiler --time-trace= Record time trace to --time-trace Record time trace to file next to output --toc-optimize (PowerPC64) Enable TOC related optimizations (default) --trace-symbol= Trace references to symbols --trace Print the names of the input files --Ttext= Same as --section-start with .text as the sectionname -T Alias for --script -t Alias for --trace --undefined-glob= Force undefined symbol during linking --undefined-version Allow unused version in version script (disabled by default) --undefined= Force undefined symbol during linking --unique Creates a separate output section for every orphan input section --unresolved-symbols= 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 Alias for --undefined --verbose-bp-section-orderer Print information on balanced partitioning --verbose Verbose mode --version-script= Read a version script --version Display the version number and exit --vs-diagnostics Format diagnostics for Visual Studio compatibility -V Alias for -v -v Display the version number --warn-backrefs-exclude= 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 extract 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 --why-extract= Print to a file about why archive members are extracted --why-live= Report a chain of references preventing garbage collection for each symbol matching --wrap= Redirect symbol references to __wrap_symbol and __real_symbol references to symbol -w Alias for --no-warnings --xosegment Put execute-only sections in their own segment -X Alias for --discard-locals -x Alias for --discard-all -y Alias for --trace-symbol -z