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.
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.
10 Command Line
14 go tool asm [flags] file
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.
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.
29 Print assembly and machine code.
31 Print assembler version and exit.
33 Dump instructions as they are parsed.
35 Support references to Go symbols defined in other shared libraries.
36 -o file
37 Write output to file. The default is foo.o for /a/b/c/foo.s.
39 Generate code that can be linked into a shared library.
40 -trimpath prefix
41 Remove prefix from recorded source file paths.
43 Write symbol ABI information to output file. Don't assemble.
44 Input language:
46 The assembler uses mostly the same syntax for all architectures,
47 the main variation having to do with addressing modes. Input is
48 run through a simplified C preprocessor that implements #include,
49 #define, #ifdef/endif, but not #if or ##.
51 For more information, see https://golang.org/doc/asm.
53 package main
View as plain text