v0.0.0-...-ae31599 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2015 License: BSD-3-Clause Imports: 8 Imported by: 0



Link, typically invoked as “go tool link,” reads the Go archive or object for a package main, along with its dependencies, and combines them into an executable binary.

Command Line


go tool link [flags] main.a


-B note
	Add an ELF_NT_GNU_BUILD_ID note when using ELF.
	The value should start with 0x and be an even number of hex digits.
-D address
	Set data segment address.
-E entry
	Set entry symbol name.
-H type
	Set executable format type.
	The default format is inferred from GOOS and GOARCH.
	On Windows, -H windowsgui writes a "GUI binary" instead of a "console binary."
-I interpreter
	Set the ELF dynamic linker to use.
-L dir1 -L dir2
	Search for imported packages in dir1, dir2, etc,
	after consulting $GOROOT/pkg/$GOOS_$GOARCH.
-R quantum
	Set address rounding quantum.
-T address
	Set text segment address.
	Print the linker version and exit.
	Set the value of the string variable in importpath named name to value.
	Note that before Go 1.5 this option took two separate arguments.
	Now it takes one argument split on the first = sign.
-buildmode mode
	Set build mode (default exe).
-cpuprofile file
	Write CPU profile to file.
	Disable generation of dynamic executables.
	The emitted code is the same in either case; the option
	controls only whether a dynamic header is included.
	The dynamic header is on by default, even without any
	references to dynamic libraries, because many common
	system tools now assume the presence of the header.
-extld linker
	Set the external linker (default "clang" or "gcc").
-extldflags flags
	Set space-separated flags to pass to the external linker.
	Ignore version mismatch in the linked archives.
	Disable Go package data checks.
-installsuffix suffix
	Look for packages in $GOROOT/pkg/$GOOS_$GOARCH_suffix
	instead of $GOROOT/pkg/$GOOS_$GOARCH.
-linkmode mode
	Set link mode (internal, external, auto).
	This sets the linking mode as described in cmd/cgo/doc.go.
	Link against installed Go shared libraries (experimental).
-memprofile file
	Write memory profile to file.
-memprofilerate rate
	Set runtime.MemProfileRate to rate.
-o file
	Write output to file (default a.out, or a.out.exe on Windows).
-r dir1:dir2:...
	Set the ELF dynamic linker search path.
	Link with race detection libraries.
	Omit the symbol table and debug information.
	Generated shared object (implies -linkmode external; experimental).
-tmpdir dir
	Write temporary files to dir.
	Temporary files are only used in external linking mode.
	Print trace of linker operations.
	Omit the DWARF symbol table.


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL