Usage: /usr/bin/ld.mold [options] file... Options: --help Report usage information -v, --version Report version information -V Report version and target information -(, --start-group Ignored -), --end-group Ignored -C DIR, --directory DIR Change to DIR before doing anything -E, --export-dynamic Put symbols in the dynamic symbol table --no-export-dynamic -F LIBNAME, --filter LIBNAME Set DT_FILTER to the specified value -I FILE, --dynamic-linker FILE Set dynamic linker path --no-dynamic-linker -L DIR, --library-path DIR Add DIR to library search path -M, --print-map Write map file to stdout -N, --omagic Do not page align data; do not make text readonly --no-omagic -O NUMBER Ignored -P AUDITLIB, --depaudit AUDITLIB Set DT_DEPAUDIT to the specified value -S, --strip-debug Strip .debug_* sections -T FILE, --script FILE Read linker script -X, --discard-locals Discard temporary local symbols (default) -e SYMBOL, --entry SYMBOL Set program entry point -f SHLIB, --auxiliary SHLIB Set DT_AUXILIARY to the specified value -h LIBNAME, --soname LIBNAME Set shared library name -l LIBNAME, --library LIBNAME Search for a given library -m TARGET Set target -o FILE, --output FILE Set output filename -q, --emit-relocs Leaves relocation sections in the output -r, --relocatable Generate relocatable output -s, --strip-all Strip .symtab section -u SYMBOL, --undefined SYMBOL Force to resolve SYMBOL -w, --no-warnings Suppress warnings -y SYMBOL, --trace-symbol SYMBOL Trace references to SYMBOL --Bdynamic, --dy Link against shared libraries (default) --Bstatic, --dn, --static Do not link against shared libraries --Bsymbolic Bind all symbols locally --Bsymbolic-functions Bind function symbols locally --Bsymbolic-non-weak Bind all but weak symbols locally --Bsymbolic-non-weak-functions Bind all but weak function symbols locally --Bno-symbolic Cancel --Bsymbolic options --Map FILE Write map file to a given file --Tbss=ADDR Set address to .bss --Tdata=ADDR Set address to .data --Ttext=ADDR Set address to .text --Ttext-segment=ADDR Set address of text segment --allow-multiple-definition Allow multiple definitions --apply-dynamic-relocs Apply link-time values for dynamic relocations (default) --no-apply-dynamic-relocs --as-needed Only set DT_NEEDED if used --no-as-needed --audit LIBNAME Set DT_AUDIT to the specified value --build-id [none,md5,sha1,sha256,fast,uuid,HEXSTRING] Generate build ID --no-build-id --chroot DIR Set a given path to the root directory --color-diagnostics=[auto,always,never] Use colors in diagnostics --color-diagnostics Alias for --color-diagnostics=auto --no-color-diagnostics Alias for --color-diagnostics=never --compress-debug-sections=[none,zlib,zlib:0,...,zlib:9,zstd,zstd:1,...,zstd:22] Compress .debug_* sections --dc Ignored --dependency-file=FILE Write Makefile-style dependency rules to FILE --defsym=SYMBOL=VALUE Define a symbol alias --demangle Demangle C++ symbols in log messages (default) --no-demangle --detach Create separate debug info file in the background (default) --no-detach --discard-none Keep all local symbols in the symbol table --enable-new-dtags Emit DT_RUNPATH for --rpath (default) --disable-new-dtags Emit DT_RPATH for --rpath --execute-only Make executable segments unreadable --dp Ignored --dynamic-list=FILE Read a list of dynamic symbols (implies -Bsymbolic) --dynamic-list-data Add data symbols to dynamic symbols --eh-frame-hdr Create .eh_frame_hdr section --no-eh-frame-hdr --exclude-libs LIB,LIB,.. Mark all symbols in given libraries as hidden --export-dynamic-symbol Put symbols matching glob in the dynamic symbol table --export-dynamic-symbol-list=FILE Read a list of dynamic symbols --fatal-warnings Treat warnings as errors --no-fatal-warnings Do not treat warnings as errors (default) --fini SYMBOL Call SYMBOL at unload-time --fork Spawn a child process (default) --no-fork --gc-sections Remove unreferenced sections --no-gc-sections --gdb-index Create .gdb_index for faster gdb startup --hash-style [sysv,gnu,both,none] Set hash style --icf=[all,safe,none] Fold identical code --no-icf --ignore-data-address-equality Allow merging non-executable sections with --icf --image-base ADDR Set the base address to a given value --init SYMBOL Call SYMBOL at load-time --nmagic Do not page align sections --no-nmagic --no-undefined Report undefined symbols (even with --shared) --noinhibit-exec Create an output file even if errors occur --oformat=binary Omit ELF, section, and program headers --pack-dyn-relocs=[relr,android,android+relr,none] Pack dynamic relocations --package-metadata=PERCENT_ENCODED_STRING Set a given string to .note.package --perf Print performance statistics --pie, --pic-executable Create a position-independent executable --no-pie, --no-pic-executable --pop-state Restore the state of flags governing input file handling --print-gc-sections[=FILE] Print, or save in FILE, removed unreferenced sections --no-print-gc-sections --print-icf-sections[=FILE] Print, or save in FILE, folded identical sections --no-print-icf-sections --push-state Save the state of flags governing input file handling --quick-exit Use quick_exit to exit (default) --no-quick-exit --relax Optimize instructions (default) --no-relax --repro Embed input files in .repro section --require-defined SYMBOL Require SYMBOL be defined in the final output --retain-symbols-file FILE Keep only symbols listed in FILE --reverse-sections Reverse input sections in the output file --rosegment Put read-only non-executable sections in their own segment (default) --no-rosegment Put read-only non-executable sections in an executable segment --rpath DIR Add DIR to the runtime search path --rpath-link DIR Ignored --run COMMAND ARG... Run COMMAND with mold as /usr/bin/ld --section-start=SECTION=ADDR Set address for section --separate-debug-file[=FILE] Separate debug info to the specified file --no-separate-debug-file --shared, --Bshareable Create a shared library --shuffle-sections[=SEED] Randomize the output by shuffling input sections --sort-common Ignored --sort-section Ignored --spare-dynamic-tags NUMBER Reserve the given number of tags in the .dynamic section --spare-program-headers NUMBER Reserve the given number of slots in the program header --start-lib Give following object files in-archive-file semantics --end-lib End the effect of --start-lib --stats Print input statistics --sysroot DIR Set the target system root directory --thread-count COUNT, --threads=COUNT Use COUNT number of threads --threads Use multiple threads (default) --no-threads --trace Print the name of each input file --undefined-glob PATTERN Force to resolve all symbols that match a given pattern --undefined-version Do not report version scripts that refer to undefined symbols --no-undefined-version Report version scripts that refer to undefined symbols (default) --unique PATTERN Don't merge input sections that match a given pattern --unresolved-symbols [report-all,ignore-all,ignore-in-object-files,ignore-in-shared-libs] Handle unresolved symbols --version-script FILE Read version script --warn-common Warn about common symbols --no-warn-common --warn-once Only warn once for each undefined symbol --warn-shared-textrel Warn if the output .so needs text relocations --warn-textrel Warn if the output file needs text relocations --warn-unresolved-symbols Report unresolved symbols as warnings --error-unresolved-symbols Report unresolved symbols as errors (default) --whole-archive Include all objects from static archives --no-whole-archive --wrap SYMBOL Use a wrapper function for a given symbol --zero-to-bss Convert all-zero data sections into BSS -z defs Report undefined symbols (even with --shared) -z undefs -z common-page-size=VALUE Ignored -z execstack Require an executable stack -z noexecstack -z execstack-if-needed Make the stack area executable if an input file explicitly requests it -z initfirst Mark DSO to be initialized first at runtime -z interpose Mark object to interpose all DSOs but the executable -z keep-text-section-prefix Keep .text.{hot,unknown,unlikely,startup,exit} as separate sections in the final binary -z nokeep-text-section-prefix -z lazy Enable lazy function resolution (default) -z max-page-size=VALUE Use VALUE as the memory page size -z nocopyreloc Do not create copy relocations -z nodefaultlib Make the dynamic loader ignore default search paths -z nodelete Mark DSO non-deletable at runtime -z nodlopen Mark DSO not available to dlopen -z nodump Mark DSO not available to dldump -z now Disable lazy function resolution -z origin Mark object requiring immediate $ORIGIN processing at runtime -z pack-relative-relocs Alias for --pack-dyn-relocs=relr -z nopack-relative-relocs -z sectionheader Do not omit section header (default) -z nosectionheader Omit section header -z start-stop-visibility=[hidden,protected] Specify symbol visibility for "__start_SECNAME" and "__stop_SECNAME" symbols -z separate-loadable-segments Separate all loadable segments onto different pages -z separate-code Separate code and data onto different pages -z noseparate-code Allow overlap in pages -z stack-size=VALUE Set the size of the stack segment -z relro Make some sections read-only after relocation (default) -z norelro -z rewrite-endbr Rewrite indirect branch target instructions with NOPs -z norewrite-endbr -z rodynamic Make the .dynamic section read-only -z text Report error if DT_TEXTREL is set -z notext -z textoff mold: supported targets: elf32-i386 elf64-x86-64 elf32-littlearm elf64-littleaarch64 elf64-bigaarch64 elf32-littleriscv elf32-bigriscv elf64-littleriscv elf64-bigriscv elf32-powerpc elf64-powerpc elf64-powerpc elf64-powerpcle elf64-s390 elf64-sparc elf32-m68k elf32-sh-linux elf64-loongarch elf32-loongarch mold: supported emulations: elf_i386 elf_x86_64 armelf_linux_eabi aarch64elf aarch64linux aarch64elfb aarch64linuxb elf32lriscv elf32briscv elf64lriscv elf64briscv elf32ppc elf32ppclinux elf64ppc elf64lppc elf64_s390 elf64_sparc m68kelf shlelf_linux shelf_linux elf64loongarch elf32loongarch