Reference

ld.lld-6.0(1)

manual page for ld.lld 6.0

NAME

ld.lld - manual page for ld.lld 6.0

DESCRIPTION

OVERVIEW: lld

USAGE: build-llvm/bin/ld.lld [options] <inputs>

OPTIONS:

--allow-multiple-definition

Allow multiple definitions

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

--Bshareable

Build a shared object

--Bstatic

Do not link against shared libraries

--Bsymbolic-functions

Bind defined function symbols locally

--Bsymbolic

Bind defined symbols locally

--build-id=<value>

Generate build ID note

--build-id

Generate build ID note

--b <value>

Change the input format of the inputs following this option

--call_shared

Link against shared libraries

--color-diagnostics=<value>

Use colors in diagnostics

--color-diagnostics

Use colors in diagnostics

--compress-debug-sections=<value>

Compress DWARF debug sections

--compress-debug-sections <value>

Compress DWARF debug sections

--dc

Assign space to common symbols

--define-common

Assign space to common symbols

--defsym=<value>

Define a symbol alias

--defsym <value>

Define a symbol alias

--demangle

Demangle symbol names

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

Do not link against shared libraries

--dp

Assign space to common symbols

--dynamic-linker <value>

Which dynamic linker to use

--dynamic-list=<value>

Read a list of dynamic symbols

--dynamic-list <value>

Read a list of dynamic symbols

--dy

Link against shared libraries

-d

Assign space to common symbols

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

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

--entry <entry>

Name of entry point symbol

--error-limit=<value>

Maximum number of errors to emit before stopping (0 = no limit)

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

--exclude-libs <value>

Exclude static libraries from automatic export

--export-dynamic-symbol=<value>

Put a symbol in the dynamic symbol table

--export-dynamic-symbol <value>

Put a symbol in the dynamic symbol table

--export-dynamic

Put symbols in the dynamic symbol table

-E

Put symbols in the dynamic symbol table

-e <value>

Name of entry point symbol

--fatal-warnings

Treat warnings as errors

--filter=<value>

Set DT_FILTER field to the specified name

--filter <value>

Set DT_FILTER field to the specified name

--fini=<symbol>

Specify a finalizer function

--fini <symbol>

Specify a finalizer function

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

--format=<input-format> Change the input format of the inputs following this option

--format <input-format> Change the input format of the inputs following this option

--full-shutdown

Perform a full shutdown instead of calling _exit

-F <value>

Set DT_FILTER field to the specified name

-f <value>

Set DT_AUXILIARY field to the specified name

--gc-sections

Enable garbage collection of unused sections

--gdb-index

Generate .gdb_index section

--hash-style=<value>

Specify hash style (sysv, gnu or both)

--hash-style <value>

Specify hash style (sysv, gnu or both)

--help

Print option help

-h <value>

Set DT_SONAME

--icf-data

Enable ICF to also fold identical read only data

--icf=all

Enable identical code folding

--icf=none

Disable identical code folding

--image-base=<value>

Set the base address

--image-base <value>

Set the base address

--init=<symbol>

Specify an initializer function

--init <symbol>

Specify an initializer function

--library-path=<dir>

Add a directory to the library search path

--library-path <dir>

Add a directory to the library search path

--library=<libName>

Root name of library to use

--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-newpm-passes=<value>

Passes to run during LTO

--lto-O<opt-level>

Optimization level for LTO

--lto-partitions=<value>

Number of LTO codegen partitions

-L <value>

Add a directory to the library search path

-l <value>

Root name of library to use

--Map=<value>

Print a link map to the specified file

--Map <value>

Print a link map to the specified file

--merge-exidx-entries

Enable merging .ARM.exidx entries

-M

Print a link map to the standard output

-m <value>

Set target emulation

--no-as-needed

Always DT_NEEDED for shared libraries

--no-color-diagnostics

Do not use colors in diagnostics

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

Disable garbage collection of unused sections

--no-gdb-index

Do not generate .gdb_index section

--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-print-gc-sections

Do not list removed unused sections

--no-rosegment

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

--no-threads

Do not run the linker multi-threaded

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

Restores the default behavior of loading archive members

--noinhibit-exec

Retain the executable output file whenever it is still usable

--non_shared

Do not link against shared libraries

--nopie

Do not create a position independent executable

--nostdlib

Only search directories specified on the command line

-N

Set the text and data sections to be readable and writable

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

--orphan-handling=<value>

Control how orphan sections are handled when linker script used

--orphan-handling <value>

Control how orphan sections are handled when linker script used

--output=<value>

Path to file to write output

--output <value>

Path to file to write output

-O <value>

Optimize output file size

-o <path>

Path to file to write output

--pack-dyn-relocs=<format>

Pack dynamic relocations in the given format (none or android)

--pic-executable

Create a position independent executable

--pie

Create a position independent executable

--plugin-opt=<value>

specifies LTO options for compatibility with GNU linkers

--plugin-opt <value>

specifies LTO options for compatibility with GNU linkers

--print-gc-sections

List removed unused sections

--print-map

Print a link map to the standard output

-q

Generate relocations in output

--relocatable

Create relocatable object file

--reproduce=<value>

Dump linker invocation and input files for debugging

--reproduce <value>

Dump linker invocation and input files for debugging

--retain-symbols-file=<file>

Retain only the symbols listed in the file

--retain-symbols-file <file>

Retain only the symbols listed in the file

--rpath=<value>

Add a DT_RUNPATH to the output

--rpath <value>

Add a DT_RUNPATH to the output

--rsp-quoting=<value>

Quoting style for response files. Values supported: windows|posix

--rsp-quoting <value>

Quoting style for response files. Values supported: windows|posix

-R <value>

Add a DT_RUNPATH to the output

-r

Create relocatable object file

--script=<value>

Read linker script

--script <value>

Read linker script

--section-start <address>

Set address of section

--shared

Build a shared object

--soname=<value>

Set DT_SONAME

--soname <value>

Set DT_SONAME

--sort-section=<value>

Specifies sections sorting rule when linkerscript is used

--sort-section <value>

Specifies sections sorting rule when linkerscript is used

--start-lib

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

--static

Do not link against shared libraries

--strip-all

Strip all symbols

--strip-debug

Strip debugging information

--symbol-ordering-file <value>

Layout sections in the order specified by symbol file

--sysroot=<value>

Set the system root

--sysroot <value>

Set the system root

-S

Strip debugging information

-s

Strip all symbols

--target1-abs

Interpret R_ARM_TARGET1 as R_ARM_ABS32

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

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

--Tbss <value>

Same as --section-start with .bss as the sectionname

--Tdata=<value>

Same as --section-start with .data 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

--trace-symbol=<value>

Trace references to symbols

--trace-symbol <value>

Trace references to symbols

--trace

Print the names of the input files

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

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

--Ttext=<value>

Same as --section-start with .text as the sectionname

--Ttext <value>

Same as --section-start with .text as the sectionname

-T <value>

Read linker script

-t

Print the names of the input files

--undefined=<value>

Force undefined symbol during linking

--undefined <value>

Force undefined symbol during linking

--unresolved-symbols=<value>

Determine how to handle unresolved symbols

--unresolved-symbols <value>

Determine how to handle unresolved symbols

-u <value>

Force undefined symbol during linking

--verbose

Verbose mode

--version-script=<value>

Read a version script

--version-script <value>

Read a version script

--version

Display the version number and exit

-V

Display the version number and exit

-v

Display the version number

--warn-common

Warn about duplicate common symbols

--warn-unresolved-symbols

Report unresolved symbols as warnings

--whole-archive

Force load of all members in a static library

--wrap=<symbol>

Use wrapper functions for symbol

--wrap <symbol>

Use wrapper functions for symbol

-X

Delete temporary local symbols

-x

Delete all local symbols

-y <value>

Trace references to symbols

-z <option>

Linker option extensions

build-llvm/bin/ld.lld: supported targets: elf32-i386 elf32-iamcu elf32-littlearm elf32-ntradbigmips elf32-ntradlittlemips elf32-powerpc elf32-tradbigmips elf32-tradlittlemips elf32-x86-64 elf64-amdgpu elf64-littleaarch64 elf64-powerpc elf64-tradbigmips elf64-tradlittlemips elf64-x86-64