]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: update flag doc
authorCherry Mui <cherryyz@google.com>
Fri, 1 Dec 2023 19:04:35 +0000 (14:04 -0500)
committerCherry Mui <cherryyz@google.com>
Fri, 1 Dec 2023 19:58:23 +0000 (19:58 +0000)
Update the go doc for linker flags. Remove flags that no longer
exist. Also remove flags that are intended for debugging the
linker from user docs. Add -aslr to the doc.

The -n flag does nothing except print a nearly useless message on
XCOFF linking. Deprecate it.

Fixes #64476.

Change-Id: I518c9c6cc009eae50b7c11308348524ad6a62b69
Reviewed-on: https://go-review.googlesource.com/c/go/+/546615
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/link/doc.go
src/cmd/link/internal/ld/main.go
src/cmd/link/internal/ld/xcoff.go

index c5f43a295443d40166e0dbb29fff6522cdf0e0fa..b0f2700ac1d2536dcf2463f4d6aeca916e84e135 100644 (file)
@@ -43,10 +43,10 @@ Flags:
                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.
        -asan
                Link with C/C++ address sanitizer support.
+       -aslr
+               Enable ASLR for buildmode=c-shared on windows (default true).
        -buildid id
                Record id as Go toolchain build id.
        -buildmode mode
@@ -64,8 +64,6 @@ Flags:
                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
@@ -104,8 +102,6 @@ Flags:
                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
@@ -116,13 +112,9 @@ Flags:
                Link with race detection libraries.
        -s
                Omit the symbol table and debug information.
-       -shared
-               Generated shared object (implies -linkmode external; experimental).
        -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
index e120f90a227fffb13ed41ea1f0cf091a093d648b..feb4ba5c1725f1654a188642791230a4fce700fe 100644 (file)
@@ -90,7 +90,7 @@ var (
        flagF             = flag.Bool("f", false, "ignore version mismatch")
        flagG             = flag.Bool("g", false, "disable go package data checks")
        flagH             = flag.Bool("h", false, "halt on error")
-       flagN             = flag.Bool("n", false, "dump symbol table")
+       flagN             = flag.Bool("n", false, "no-op (deprecated)")
        FlagS             = flag.Bool("s", false, "disable symbol table")
        flag8             bool // use 64-bit addresses in symbol table
        flagInterpreter   = flag.String("I", "", "use `linker` as ELF dynamic linker")
index 2f887366b73da4b1fccb5d60819a1b55d3ea776c..d915ab393b541b5afed94caeddd9ab73230e4339 100644 (file)
@@ -1140,7 +1140,7 @@ func (f *xcoffFile) asmaixsym(ctxt *Link) {
                putaixsym(ctxt, s, TextSym)
        }
 
-       if ctxt.Debugvlog != 0 || *flagN {
+       if ctxt.Debugvlog != 0 {
                ctxt.Logf("symsize = %d\n", uint32(symSize))
        }
        xfile.updatePreviousFile(ctxt, true)