Source file src/cmd/asm/doc.go
1 // Copyright 2015 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 /* 6 Asm, typically invoked as ``go tool asm'', assembles the source file into an object 7 file named for the basename of the argument source file with a .o suffix. The 8 object file can then be combined with other objects into a package archive. 9 10 Command Line 11 12 Usage: 13 14 go tool asm [flags] file 15 16 The specified file must be a Go assembly file. 17 The same assembler is used for all target operating systems and architectures. 18 The GOOS and GOARCH environment variables set the desired target. 19 20 Flags: 21 22 -D name[=value] 23 Predefine symbol name with an optional simple value. 24 Can be repeated to define multiple symbols. 25 -I dir1 -I dir2 26 Search for #include files in dir1, dir2, etc, 27 after consulting $GOROOT/pkg/$GOOS_$GOARCH. 28 -S 29 Print assembly and machine code. 30 -V 31 Print assembler version and exit. 32 -debug 33 Dump instructions as they are parsed. 34 -dynlink 35 Support references to Go symbols defined in other shared libraries. 36 -gensymabis 37 Write symbol ABI information to output file. Don't assemble. 38 -o file 39 Write output to file. The default is foo.o for /a/b/c/foo.s. 40 -shared 41 Generate code that can be linked into a shared library. 42 -spectre list 43 Enable spectre mitigations in list (all, ret). 44 -trimpath prefix 45 Remove prefix from recorded source file paths. 46 47 Input language: 48 49 The assembler uses mostly the same syntax for all architectures, 50 the main variation having to do with addressing modes. Input is 51 run through a simplified C preprocessor that implements #include, 52 #define, #ifdef/endif, but not #if or ##. 53 54 For more information, see https://golang.org/doc/asm. 55 */ 56 package main 57