Skip to content

cmd/link: unused runtime-internal exported methods aren't getting deadcoded #70670

Open
@randall77

Description

@randall77

For example, internal/abi.(*SwissMapType).NeedKeyUpdate. It has a 3-instruction body and gets inlined everywhere. There is no reference to it from any code. But it still exists in the binary.
Probably this is because it is exported (starts with a capital letter), and the type *SwissMapType is reachable somehow.

Kind of anecdotal at the moment, but this may be the cause of part of the binary size increase since 1.23.

@cherrymui

A few other examples:

internal/chacha8rand.(*State).Next
sync.(*noCopy).Lock

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions