LD.LLD(1) General Commands Manual LD.LLD(1) (NAME) ld.lld - ELF LLVM (SYNOPSIS) ld.lld [options] objfile ... (DESCRIPTION) (object) ( ) . (relocate) . ld.lld GNU BFD gold . GNU . ld.lld i386 x86-64 ARM AArch64 LoongArch PowerPC32 PowerPC64 MIPS32 MIPS64 RISC-V AMDGPU Hexagon SPARC V9 . ld.lld lld-link link.exe ld.ld64 ld macOS . ld.lld ld.lld (native) (cross linker) . (OPTIONS) . o . o -o path . --allow-multiple-definition . . --allow-shlib-undefined . . --apply-dynamic-relocs . --as-needed DT_NEEDED . --auxiliary=value DT_AUXILIARY . --Bdynamic, --dy . --Bstatic, --static, --dn . -Bno-symbolic -shared (). -Bsymbolic -shared. DF_SYMBOLIC . -Bsymbolic-non-weak STB_GLOBAL -shared. -Bsymbolic-functions -shared. -Bsymbolic-non-weak-functions STB_GLOBAL -shared. --be8 ELF (Big Endian) BE8 ( AArch32). --branch-to-branch : ( AArch64 X86_64). -O2 . --build-id=value (build ID note). value fast md5 sha1 tree uuid 0xhex-string none . tree sha1 . fast md5 sha1 tree . fast . --build-id --build-id=sha1. --call-graph-profile-sort=algorithm algorithm : none . hfsort hfsort. cdsort cdsort (). --color-diagnostics=value . value always auto never . auto . --color-diagnostics --color-diagnostics=auto. --compress-debug-sections=value DWARF. . value : none . zlib () . zstd zstd. --compress-sections=section-glob={none,zlib,zstd}[:level] glob SHF_ALLOC . . level ( ) . --compress-debug-sections . --cref . -Map (map file) . --debug-names .debug_names. --default-script=file, -dT file --script . --defsym=symbol=expression . expression . `--defsym=foo=bar' `--defsym=foo=bar+0x100'. --demangle (Demangle). --disable-new-dtags . --discard-all, -x . --discard-locals, -X . --discard-none . --dynamic-linker=value . ELF PT_INTERP . --dynamic-list=file --export-dynamic-symbol-list. -Bsymbolic DF_SYMBOLIC . --EB OUTPUT_FORMAT. --EL OUTPUT_FORMAT. --eh-frame-hdr .eh_frame_hdr PT_GNU_EH_FRAME. --emit-relocs, -q . --enable-new-dtags . --enable-non-contiguous-regions . --end-lib . --entry=entry . --error-limit=value . . --error-unresolved-symbols . --error-handing-script=script_path script_path tag . 0 . ..Ar tag missing-lib undefined-symbol . --execute-only . AArch64 . --exclude-libs=value . --export-dynamic, -E . --export-dynamic-symbol=glob ( ) . ( ) STV_DEFAULT -Bsymbolic -Bsymbolic-functions --dynamic-list . --export-dynamic-symbol-list=file file . --export-dynamic-symbol . --fatal-warnings . --filter=value, -F value DT_FILTER . --fini=symbol (finalizer) . --force-group-allocation -r . . (relocations) . --format=input-format, -b input-format . input-format binary elf default . default elf . --gc-sections (garbage collection) . --gdb-index .gdb_index . --hash-style=value (hash style) . value sysv gnu both . both . --help . --icf=all (identical code folding) . --icf=safe . --icf=none . --ignore-data-address-equality . C/C++ . lld : . --ignore-function-address-equality . -PIC . . --image-base=value value . --init=symbol (initializer) . --keep-unique=symbol symbol ICF . -l libName, --library=libName . -L dir, --library-path=dir . --lto-aa-pipeline=value AA LTO. --lto-newpm-passes . --lto-newpm-passes=value (passes) LTO. --lto-Oopt-level LTO. --lto-partitions=value (codegen) LTO. -m value . --Map=file, -M file (link map) file . --nmagic, -n . --no-allow-shlib-undefined . . --no-as-needed DT_NEEDED . --no-color-diagnostics . --no-demangle (demangle) . --no-dynamic-linker .interp . --no-fortran-common COMMON . --no-gc-sections . --no-gnu-unique STB_GNU_UNIQUE . --no-merge-exidx-entries .ARM.exidx . --no-nmagic . --no-omagic . --no-relax (relaxations) . x86-64 GOT R_X86_64_GOTPCRELX R_X86_64_REX_GOTPCRELX . --no-rosegment (segment) . --undefined-version . --no-undefined . --no-warn-mismatch . --no-warn-symbol-ordering . --no-warnings, -w --fatal-warnings . --no-whole-archive . --no-pie, --no-pic-executable (PIE) . --noinhibit-exec . --nostdlib . -o path path . a.out . -Ovalue . value : 0 . 1 . 2 (string tail merging) -- . -O1 . --oformat=format . format binary ELF . --omagic, -N text data (page align) . --opt-remarks-filename file YAML file . --opt-remarks-passes pass-regex (passes) pass-regex . --opt-remarks-with-hotness (hotness) . --orphan-handling=mode (orphan sections) . . mode : place . warn place . error place . place . --pack-dyn-relocs=format . format : none . SHT_REL(A) . android SHT_ANDROID_REL(A). relr SHT_RELR SHT_REL(A). android+relr SHT_RELR SHT_ANDROID_REL(A). none . --use-android-relr-tags SHT_RELR SHT_ANDROID_RELR . --package-metadata (percent-encoded) .note.package. %25 % . --pic-veneer thunk . --pie, --pic-executable (position independent executable) . --power10-stubs=mode Power10 (call stubs) R_PPC64_REL24_NOTOC TOC/NOTOC. mode : yes () . auto yes . no . --print-gc-sections . --print-gc-sections=file . --print-icf-sections (identical folded sections). --print-map . --print-archive-stats=file . . --push-state --as-needed, --static, --whole-archive. --pop-state --push-state. --randomize-section-padding=seed (padding) seed . : .bss, .data, .data.rel.ro, .lbss, .ldata, .lrodata, .ltext, .rodata .text*. ---relax-gp (global pointer relaxation) RISC-V. --relocatable, -r . --remap-inputs=from-glob=to-file from-glob to-file . /dev/null . --remap-inputs-file=file file. from-glob=to-file # . --reproduce=path tar path response.txt version.txt ld.lld --version . . --retain-symbols-file=file . --rpath=value, -R value DT_RUNPATH . --rsp-quoting=value . windows posix . --script=file, -T file file. . --section-start=section=address . --shared, --Bsharable (shared object). --shuffle-sections=seed seed . -1 . 0 seed . --soname=value, -h value DT_SONAME value. --sort-common GNU . --sort-section=value linkerscript . --start-lib . --strip-all, -s . --strip-debug . --strip-debug, -S . --symbol-ordering-file=file file . --sysroot=value . --target1-abs R_ARM_TARGET1 R_ARM_ABS32. --target1-rel R_ARM_TARGET1 R_ARM_REL32. --target2=type R_ARM_TARGET2 type, type rel, abs, got-rel . --Tbss=value --section-start .bss . --Tdata=value --section-start .data . --Ttext=value --section-start .text . --thinlto-cache-dir=value ThinLTO. --thinlto-cache-policy=value ThinLTO. --thinlto-jobs=value ThinLTO. --threads=N . all () . 1 . --fat-lto-objects .llvm.lto LLVM fat LTO LTO..It Fl -no-fat-lto-objects .llvm.lto (relocatable) (). --time-trace (time trace). --time-trace-file=file file. --time-trace-granularity=value ( ) . --trace . --trace-symbol=symbol, -y symbol symbol. --undefined=symbol, -u symbol symbol . --undefined-glob=pattern --undefined - glob . glob * ? [...] . --undefined . --unique (orphan) . --unresolved-symbols=value (unresolved). value : report-all (). ignore-in-object-files . ignore-in-shared-libs . ignore-all . --use-android-relr-tags SHT_ANDROID_RELR / DT_ANDROID_RELR* SHT_RELR / DT_RELR*. -v, -V . --version . --verbose (verbose). --version-script=file file. --warn-backrefs . . --warn-backrefs-exclude=glob glob ( --start-lib) --warn-backrefs . --warn-common (common symbols) . --warn-ifunc-textrel ifunc (text relocations). glibc ( . ) ifunc . ifunc segmentation fault . -warn-ifunc-textrel ifunc glibc lld . . ld gold . --warn-unresolved-symbols . --whole-archive . --why-extract=file . --why-live=glob (garbage collection) glob . --wrap=symbol symbol __wrap_symbol __real_symbol symbol. -z option . dead-reloc-in-nonalloc=section_glob=value SHF_ALLOC value glob . . execstack (main stack). PT_GNU_STACK . bti-report=[none|warning|error] GNU_PROPERTY_AARCH64_FEATURE_1_BTI. none . cet-report=[none|warning|error] GNU_PROPERTY_X86_FEATURE_1_IBT GNU_PROPERTY_X86_FEATURE_1_SHSTK. none . gcs-report=[none|warning|error] GNU_PROPERTY_AARCH64_FEATURE_1_GCS. GNU_PROPERTY_AARCH64_FEATURE_1_GCS Guarded Control Stack . none . dynamic-undefined-weak (weak) . nodynamic-undefined-weak . dynamic-undefined-weak (shared object) . pauth-report=[none|warning|error] GNU_PROPERTY_AARCH64_FEATURE_PAUTH. none . force-bti BTI AArch64 PLT ELF GNU_PROPERTY_AARCH64_FEATURE_1_BTI . force-ibt Intel Indirect Branch Tracking PLT ELF GNU_PROPERTY_X86_FEATURE_1_IBT . global DF_1_GLOBAL DYNAMIC. . ifunc-noplt PLT ifunc. resolver . (standalone) . -z notext . initfirst DF_1_INITFIRST (module) . interpose DF_1_INTERPOSE interposer . interposer ..Pp lrodata-after-bss .lrodata .bss. muldefs . . --allow-multiple-definition . nocombreloc (relocation). nocopyreloc (copy relocations). nodefaultlib DF_1_NODEFLIB . nodelete DF_1_NODELETE . nodlopen DF_1_NOOPEN dlopen(3) . nognustack PT_GNU_STACK. norelro . PT_GNU_RELRO . nosectionheader (section header table). notext . DT_TEXTREL DYNAMIC . now DF_BIND_NOW (run- time loader) . . origin DF_ORIGIN $ORIGIN . pac-plt AArch64 PLT. pack-relative-relocs -pack-dyn-relocs=relr GLIBC_2.* GLIBC_ABI_DT_RELR . ld.so glibc GLIBC_ABI_DT_RELR . rel REL . rela RELA . retpolineplt PLT retpoline CVE-2017-5715. rodynamic .dynamic. DT_DEBUG . separate-loadable-segments separate-code noseparate-code PT_LOAD . noseparate-code () . separate-code . separate-loadable-segments . shstk x86 (shadow stack). gcs=[implicit|never|always] GNU_PROPERTY_AARCH64_FEATURE_1_GCS ELF . (GCS) . implicit () GCS .note.gnu.property GNU_PROPERTY_AARCH64_FEATURE_1_GCS . never GCS . always GCS . stack-size=size size. size. PT_GNU_STACK . start-stop-gc __start_/__stop_ C (). nostart-stop-gc __start_/__stop_ C . text . . nobtcfi PT_OPENBSD_NOBTCFI. wxneeded PT_OPENBSD_WXNEEDED. LLD_REPRODUCE tarball . --reproduce --reproduce . LLD_VERSION ld.lld .comment LLD . LLD . (IMPLEMENTATION NOTES) ( .a ) ld.lld . . . . . . --start-group --end-group . ld.lld . ld.lld . ld.lld . ld.lld . --warn-backrefs . Linux 6.12.113+deb13-amd64 July 25, 2023 Linux 6.12.113+deb13-amd64