]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: update -T flag's documentation
authorCherry Mui <cherryyz@google.com>
Wed, 1 Mar 2023 00:10:44 +0000 (19:10 -0500)
committerCherry Mui <cherryyz@google.com>
Wed, 1 Mar 2023 18:12:05 +0000 (18:12 +0000)
The -T flag actually means the start address of text symbols, not
the text sections, which may differ by the header size. It has
been behaving like this since at least 2009. Make it clear in the
documentation.

Also remove the -D flag from the doc. The flag doesn't actually
exist in the implementation.

Fixes #58727.

Change-Id: Ic5b7e93adca3f1ff9f0de33dbb6089f46cdf4738
Reviewed-on: https://go-review.googlesource.com/c/go/+/472356
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/doc.go
src/cmd/link/internal/ld/main.go

index a5701327141ecb62a2c870cf62098a6cbc4c6c8f..ce0166faa5cac61310427711ad2b10ec0236e7d4 100644 (file)
@@ -18,8 +18,6 @@ Flags:
        -B note
                Add an ELF_NT_GNU_BUILD_ID note when using ELF.
                The value should start with 0x and be an even number of hex digits.
-       -D address
-               Set data segment address.
        -E entry
                Set entry symbol name.
        -H type
@@ -34,7 +32,7 @@ Flags:
        -R quantum
                Set address rounding quantum.
        -T address
-               Set text segment address.
+               Set the start address of text symbols.
        -V
                Print linker version and exit.
        -X importpath.name=value
index 396eb221df57e30c63203c340116c5a63804bc82..8511e5de63179bc7349c838d06d776d37310a9c3 100644 (file)
@@ -98,7 +98,7 @@ var (
        flagDebugNosplit  = flag.Bool("debugnosplit", false, "dump nosplit call graph")
        FlagStrictDups    = flag.Int("strictdups", 0, "sanity check duplicate symbol contents during object file reading (1=warn 2=err).")
        FlagRound         = flag.Int("R", -1, "set address rounding `quantum`")
-       FlagTextAddr      = flag.Int64("T", -1, "set text segment `address`")
+       FlagTextAddr      = flag.Int64("T", -1, "set the start address of text symbols")
        flagEntrySymbol   = flag.String("E", "", "set `entry` symbol name")
        flagPruneWeakMap  = flag.Bool("pruneweakmap", true, "prune weak mapinit refs")
        cpuprofile        = flag.String("cpuprofile", "", "write cpu profile to `file`")