cmd/compile, cmd/link: document more flags

Fixes #26533

Change-Id: I5a48d667d474f3f222f9055e51131561a0cf45b6
Reviewed-on: https://go-review.googlesource.com/c/138757
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/src/cmd/compile/doc.go b/src/cmd/compile/doc.go
index e2a19d9..5291a8b 100644
--- a/src/cmd/compile/doc.go
+++ b/src/cmd/compile/doc.go
@@ -44,8 +44,12 @@
 		Print compiler version and exit.
 	-asmhdr file
 		Write assembly header to file.
+	-buildid id
+		Record id as the build id in the export metadata.
 	-blockprofile file
 		Write block profile for the compilation to file.
+	-c int
+		Concurrency during compilation. Set 1 for no concurrency (default is 1).
 	-complete
 		Assume package has no non-Go components.
 	-cpuprofile file
@@ -54,8 +58,14 @@
 		Allow references to Go symbols in shared libraries (experimental).
 	-e
 		Remove the limit on the number of errors reported (default limit is 10).
+	-goversion string
+		Specify required go tool version of the runtime.
+		Exits when the runtime go version does not match goversion.
 	-h
 		Halt with a stack trace at the first error detected.
+	-importcfg file
+		Read import configuration from file.
+		In the file, set importmap, packagefile to specify import resolution.
 	-importmap old=new
 		Interpret import "old" as import "new" during compilation.
 		The option may be repeated to add multiple mappings.
@@ -74,6 +84,8 @@
 		object to usual output file (as specified by -o).
 		Without this flag, the -o output is a combination of both
 		linker and compiler input.
+	-m
+		Print optimization decisions.
 	-memprofile file
 		Write memory profile for the compilation to file.
 	-memprofilerate rate
@@ -93,11 +105,50 @@
 		Write a package (archive) file rather than an object file
 	-race
 		Compile with race detector enabled.
+	-s
+		Warn about composite literals that can be simplified.
+	-shared
+		Generate code that can be linked into a shared library.
+	-traceprofile file
+		Write an execution trace to file.
 	-trimpath prefix
 		Remove prefix from recorded source file paths.
 
-There are also a number of debugging flags; run the command with no arguments
-for a usage message.
+Flags related to debugging information:
+
+	-dwarf
+		Generate DWARF symbols.
+	-dwarflocationlists
+		Add location lists to DWARF in optimized mode.
+	-gendwarfinl int
+		Generate DWARF inline info records (default 2).
+
+Flags to debug the compiler itself:
+
+	-E
+		Debug symbol export.
+	-K
+		Debug missing line numbers.
+	-d list
+		Print debug information about items in list. Try -d help for further information.
+	-live
+		Debug liveness analysis.
+	-v
+		Increase debug verbosity.
+	-%
+		Debug non-static initializers.
+	-W
+		Debug parse tree after type checking.
+	-f
+		Debug stack frames.
+	-i
+		Debug line number stack.
+	-j
+		Debug runtime-initialized variables.
+	-r
+		Debug generated wrappers.
+	-w
+		Debug type checking.
 
 Compiler Directives
 
diff --git a/src/cmd/link/doc.go b/src/cmd/link/doc.go
index 963d86a..219499b 100644
--- a/src/cmd/link/doc.go
+++ b/src/cmd/link/doc.go
@@ -43,8 +43,16 @@
 		or initialized to a constant string expression. -X will not work if the initializer makes
 		a function call or refers to other variables.
 		Note that before Go 1.5 this option took two separate arguments.
+	-a
+		Disassemble output.
+	-buildid id
+		Record id as Go toolchain build id.
 	-buildmode mode
 		Set build mode (default exe).
+	-c
+		Dump call graphs.
+	-compressdwarf
+		Compress DWARF if possible (default true).
 	-cpuprofile file
 		Write CPU profile to file.
 	-d
@@ -54,6 +62,10 @@
 		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.
+	-debugtramp int
+		Debug trampolines.
+	-dumpdep
+		Dump symbol dependency graph.
 	-extar ar
 		Set the external archive program (default "ar").
 		Used only for -buildmode=c-archive.
@@ -65,9 +77,14 @@
 		Ignore version mismatch in the linked archives.
 	-g
 		Disable Go package data checks.
+	-importcfg file
+		Read import configuration from file.
+		In the file, set packagefile, packageshlib to specify import resolution.
 	-installsuffix suffix
 		Look for packages in $GOROOT/pkg/$GOOS_$GOARCH_suffix
 		instead of $GOROOT/pkg/$GOOS_$GOARCH.
+	-k symbol
+		Set field tracking symbol. Use this flag when GOEXPERIMENT=fieldtrack is set.
 	-libgcc file
 		Set name of compiler support library.
 		This is only used in internal link mode.
@@ -85,6 +102,8 @@
 		Set runtime.MemProfileRate to rate.
 	-msan
 		Link with C/C++ memory sanitizer support.
+	-n
+		Dump symbol table.
 	-o file
 		Write output to file (default a.out, or a.out.exe on Windows).
 	-pluginpath path
@@ -100,6 +119,8 @@
 	-tmpdir dir
 		Write temporary files to dir.
 		Temporary files are only used in external linking mode.
+	-u
+		Reject unsafe packages.
 	-v
 		Print trace of linker operations.
 	-w