Skip to content

cmd/link: documentation should mention that -s implies -w #71051

@rittneje

Description

@rittneje

Go version

n/a

Output of go env in your module/workspace:

n/a

What did you do?

Read the documentation for go tool link, specifically with regards to the -s and -w flags.

What did you see happen?

There documentation only states:

-s
	Omit the symbol table and debug information.
[...]
-w
	Omit the DWARF symbol table.

Only the Go 1.22 release notes seem to explain their interaction.

The linker’s -s and -w flags are now behave more consistently across all platforms. The -w flag suppresses DWARF debug information generation. The -s flag suppresses symbol table generation. The -s flag also implies the -w flag, which can be negated with -w=0. That is, -s -w=0 will generate a binary with DWARF debug information generation but without the symbol table.

What did you expect to see?

The documentation for -s should explicitly say that it implies -w by default, and that you can override this by explicitly passing -w=0. (In short, developers should not have to track down the 1.22 release notes to understand how these two flags interact.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FixPendingIssues that have a fix which has not yet been reviewed or submitted.NeedsFixThe path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions