Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
LD.LLD(1)		FreeBSD	General	Commands Manual		     LD.LLD(1)

     ld.lld -- ELF linker from the LLVM	project

     ld.lld [options] objfile ...

     A linker takes one	or more	object,	archive, and library files, and	com-
     bines them	into an	output file (an	executable, a shared library, or
     another object file).  It relocates code and data from the	input files
     and resolves symbol references between them.

     ld.lld is a drop-in replacement for the GNU BFD and gold linkers.	It
     accepts most of the same command line arguments and linker	scripts	as GNU

     Many options have both a single-letter and	long form.  When using the
     long form options other than those	beginning with the letter o may	be
     specified using either one	or two dashes preceeding the option name.
     Long options beginning with o require two dashes to avoid confusion with
     the -o path option.

     These options are available:

	     Do	not error if a symbol is defined multiple times.  The first
	     definition	will be	used.

	     Only set DT_NEEDED	for shared libraries if	used.

     --auxiliary value
	     Set the DT_AUXILIARY field	to the specified name.

	     Link against shared libraries.

	     Do	not link against shared	libraries.

	     Bind defined function symbols locally.

	     Bind defined symbols locally.

	     Generate a	build ID note.	value may be one of md5, sha1, tree,
	     uuid, 0xhex-string, and none.  tree is an alias for sha1.	Build-
	     IDs of type md5, sha1, and	tree are calculated from the object

	     Generate a	build ID note.

	     Use colors	in diagnostics.	 value may be one of always, auto, and
	     never.  auto enables color	if and only if output is to a termi-

	     Alias for --color-diagnostics=auto.

	     Compress DWARF debug sections.  value may be none or zlib.

	     Assign space to common symbols.

	     Define a symbol alias.  expression	may be another symbol or a
	     linker script expression.	For example, --defsym=foo=bar or

	     Demangle symbol names.

	     Disable new dynamic tags.

	     Delete all	local symbols.

	     Delete temporary local symbols.

	     Keep all symbols in the symbol table.

     --dynamic-linker value
	     Specify the dynamic linker	to be used for a dynamically linked
	     executable.  This is recorded in an ELF segment of	type

     --dynamic-list file
	     Read a list of dynamic symbols from file.

	     Request creation of .eh_frame_hdr section and PT_GNU_EH_FRAME
	     segment header.

	     Generate relocations in the output.

	     Enable new	dynamic	tags.

	     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.	A value	of
	     zero indicates that there is no limit.

	     Report unresolved symbols as errors.

     --exclude-libs value
	     Exclude static libraries from automatic export.

     --export-dynamic-symbol symbol
	     Include symbol in the dynamic symbol table.

	     Put symbols in the	dynamic	symbol table.

	     Treat warnings as errors.

	     Set the DT_FILTER field to	the specified value.

     --fini symbol
	     Specify a finalizer function.

	     Specify the format	of the inputs following	this option.
	     input-format may be one of	binary,	elf, and default.  default is
	     a synonym for elf.

	     Enable garbage collection of unused sections.

	     Generate .gdb_index section.

     --hash-style value
	     Specify hash style.  value	may be sysv, gnu, or both.  both is
	     the default.

     --help  Print a usage message.

	     Enable identical code folding.

	     Disable identical code folding.

	     Set the base address to value.

     --init symbol
	     Specify an	initializer function.

	     AA	pipeline to run	during LTO.  Used in conjunction with

	     Passes to run during LTO.

     --lto-O opt-level
	     Optimization level	for LTO.

	     Number of LTO codegen partitions.

     -L	dir  Add a directory to	the library search path.

     -l	libName
	     Root name of library to use.

     --Map file
	     Print a link map to file.

     -m	value
	     Set target	emulation.

	     Always set	DT_NEEDED for shared libraries.

	     Do	not use	colors in diagnostics.

	     Do	not assign space to common symbols.

	     Do	not demangle symbol names.

	     Inhibit output of an .interp section.

	     Disable garbage collection	of unused sections.

	     Disable STB_GNU_UNIQUE symbol binding.

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

	     Do	not run	the linker multi-threaded.

	     Report version scripts that refer undefined symbols.

	     Report unresolved symbols even if the linker is creating a	shared

	     Restores the default behavior of loading archive members.

	     Retain the	executable output file whenever	it is still usable.

	     Do	not create a position independent executable.

	     Only search directories specified on the command line.

     --oformat format
	     Specify the format	for the	output object file.  The only sup-
	     ported format is binary, which produces output with no ELF

	     Set the text and data sections to be readable and writable.

     --opt-remarks-filename file
	     Write optimization	remarks	in YAML	format to file.

	     Include hotness information in the	optimization remarks file.

     -O	value
	     Optimize output file size.	 value may be:

	     O0	     Disable string merging.

	     O1	     Enable string merging.

	     O2	     Enable string tail	merging.
	     O1	is the default.

     -o	path
	     Write the output executable, library, or object to	path.  If not
	     specified,	a.out is used as a default.

     --pie   Create a position independent executable.

	     List removed unused sections.

	     Print a link map to the standard output.

	     Create relocatable	object file.

     --reproduce value
	     Dump linker invocation and	input files for	debugging.

	     Retain only the symbols listed in the file.

     --rpath value
	     Add a DT_RUNPATH to the output.

	     Quoting style for response	files.	The supported values are
	     windows and posix.

     --script file
	     Read linker script	from file.

     --section-start address
	     Set address of section.

	     Build a shared object.

	     Set DT_SONAME to value.

     --sort-section value
	     Specifies sections	sorting	rule when linkerscript is used.

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

	     Strip all symbols.

	     Strip debugging information.

     --symbol-ordering-file file
	     Lay out sections in the order specified by	file.

	     Set the system root.

	     Interpret R_ARM_TARGET1 as	R_ARM_ABS32.

	     Interpret R_ARM_TARGET1 as	R_ARM_REL32.

	     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.

	     Path to ThinLTO cached object file	directory.

     --thinlto-cache-policy value
	     Pruning policy for	the ThinLTO cache.

	     Number of ThinLTO jobs.

	     Run the linker multi-threaded.  This option is enabled by

     --trace-symbol symbol
	     Trace references to symbol.

	     Print the names of	the input files.

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

     --undefined symbol
	     Force symbol to be	an undefined symbol during linking.

	     Determine how to handle unresolved	symbols.

	     Verbose mode.

     --version-script file
	     Read version script from file.

     -V, --version
	     Display the version number	and exit.

     -v	     Display the version number	and proceed with linking if object
	     files are specified.

	     Warn about	duplicate common symbols.

	     Report unresolved symbols as warnings.

	     Force load	of all members in a static library.

     --wrap symbol
	     Use wrapper functions for symbol.

     -z	option
	     Linker option extensions.

		     Make the main stack executable.  Stack permissions	are
		     recorded in the PT_GNU_STACK segment.

		     Do	not emit PLT entries for GNU ifuncs.  Instead, pre-
		     serve relocations for ifunc call sites so that they may
		     be	applied	by a run-time loader.  Note that this feature
		     requires special loader support and will generally	result
		     in	application crashes when used outside of freestanding

		     Set the DF_1_INTERPOSE flag to indicate that the object
		     is	an interposer.	Runtime	linkers	perform	symbol resolu-
		     tion by first searching the application, followed by
		     interposers, and then any other dependencies.

		     Do	not error if a symbol is defined multiple times.  The
		     first definition will be used.  This is a synonym for

		     Disable combining and sorting multiple relocation sec-

		     Disable the creation of copy relocations.

		     Set the DF_1_NODELETE flag	to indicate that the object
		     cannot be unloaded	from a process.

		     Set the DF_1_NOOPEN flag to indcate that the object may
		     not be opened by dlopen(3).

		     Do	not indicate that portions of the object shold be
		     mapped read-only after initial relocation processing.
		     The object	will omit the PT_GNU_RELRO segment.

	     notext  Allow relocations against read-only segments.  Sets the
		     DT_TEXTREL	flag in	the DYNAMIC section.

	     now     Set the DF_BIND_NOW flag to indicate that the run-time
		     loader should perform all relocation processing as	part
		     of	object initialization.	By default relocations may be
		     performed on demand.

	     origin  Set the DF_ORIGIN flag to indicate	that the object
		     requires $ORIGIN processing.

		     Emit retpoline format PLT entries as a mitigation for

		     Make the .dynamic section read-only.  The DT_DEBUG	tag
		     will not be emitted.

		     Set the main thread's stack size to size.	The stack size
		     is	recorded as the	size of	the size.  PT_GNU_STACK	pro-
		     gram segment.

	     text    Do	not allow relocations against read-only	segments.
		     This is the default.

		     Create a PT_OPENBSD_WXNEEDED segment.

FreeBSD	Ports 11.2	      September	14, 2018	    FreeBSD Ports 11.2


Want to link to this manual page? Use this URL:

home | help