github.com/akaros/go-akaros@v0.0.0-20181004170632-85005d477eab/src/cmd/ld/doc.go (about) 1 // Copyright 2009 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // +build ignore 6 7 /* 8 9 Ld is the portable code for a modified version of the Plan 9 linker. The original is documented at 10 11 http://plan9.bell-labs.com/magic/man2html/1/8l 12 13 It reads object files (.5, .6, or .8 files) and writes a binary named for the 14 architecture (5.out, 6.out, 8.out) by default (if $GOOS is windows, a .exe suffix 15 will be appended). 16 17 Major changes include: 18 - support for ELF, Mach-O and PE binary files 19 - support for segmented stacks (this feature is implemented here, not in the compilers). 20 21 Original options are listed on the manual page linked above. 22 23 Usage: 24 go tool 6l [flags] mainObj 25 Substitute 6l with 8l or 5l as appropriate. 26 27 Options new in this version: 28 29 -d 30 Elide the dynamic linking header. With this option, the binary 31 is statically linked and does not refer to a dynamic linker. Without this option 32 (the default), the binary's contents are identical but it is loaded with a dynamic 33 linker. This flag cannot be used when $GOOS is windows. 34 -H darwin (only in 6l/8l) 35 Write Apple Mach-O binaries (default when $GOOS is darwin) 36 -H dragonfly (only in 6l/8l) 37 Write DragonFly ELF binaries (default when $GOOS is dragonfly) 38 -H linux 39 Write Linux ELF binaries (default when $GOOS is linux) 40 -Hakaros 41 Write Akaros ELF binaries (default when $GOOS is akaros) 42 -H freebsd 43 Write FreeBSD ELF binaries (default when $GOOS is freebsd) 44 -H netbsd 45 Write NetBSD ELF binaries (default when $GOOS is netbsd) 46 -H openbsd (only in 6l/8l) 47 Write OpenBSD ELF binaries (default when $GOOS is openbsd) 48 -H solaris (only in 6l) 49 Write Solaris ELF binaries (default when $GOOS is solaris) 50 -H windows (only in 6l/8l) 51 Write Windows PE32+ Console binaries (default when $GOOS is windows) 52 -H windowsgui (only in 6l/8l) 53 Write Windows PE32+ GUI binaries 54 -I interpreter 55 Set the ELF dynamic linker to use. 56 -L dir1 -L dir2 57 Search for libraries (package files) in dir1, dir2, etc. 58 The default is the single location $GOROOT/pkg/$GOOS_$GOARCH. 59 -r dir1:dir2:... 60 Set the dynamic linker search path when using ELF. 61 -s 62 Omit the symbol table and debug information. 63 -V 64 Print the linker version. 65 -w 66 Omit the DWARF symbol table. 67 -X symbol value 68 Set the value of a string variable. The symbol name 69 should be of the form importpath.name, as displayed 70 in the symbol table printed by "go tool nm". 71 -race 72 Link with race detection libraries. 73 -B value 74 Add a NT_GNU_BUILD_ID note when using ELF. The value 75 should start with 0x and be an even number of hex digits. 76 -Z 77 Zero stack on function entry. This is expensive but it might 78 be useful in cases where you are suffering from false positives 79 during garbage collection and are willing to trade the CPU time 80 for getting rid of the false positives. 81 NOTE: it only eliminates false positives caused by other function 82 calls, not false positives caused by dead temporaries stored in 83 the current function call. 84 -linkmode argument 85 Set the linkmode. The argument must be one of 86 internal, external, or auto. The default is auto. 87 This sets the linking mode as described in 88 ../cgo/doc.go. 89 -tmpdir dir 90 Set the location to use for any temporary files. The 91 default is a newly created directory that is removed 92 after the linker completes. Temporary files are only 93 used in external linking mode. 94 -extld name 95 Set the name of the external linker to use in external 96 linking mode. The default is "gcc". 97 -extldflags flags 98 Set space-separated trailing flags to pass to the 99 external linker in external linking mode. The default 100 is to not pass any additional trailing flags. 101 */ 102 package main