Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/link: support symbol indexing for DUPOK symbols #47448

Open
mdempsky opened this issue Jul 28, 2021 · 3 comments
Open

cmd/link: support symbol indexing for DUPOK symbols #47448

mdempsky opened this issue Jul 28, 2021 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mdempsky
Copy link
Member

A common situation within the compiler is package A defines a DUPOK symbol X, package B imports package A, and then package B needs to refer to that same DUPOK symbol X.

Today, we handle this by having package B re-defined symbol X, and the linker discards the duplicates. This works fine (and in general, we do need the linker to support DUPOK symbols), but it means the compiler spends unnecessary time re-defining the symbol, and it means the object files are unnecessarily large with redundant definitions.

It would be nice if we could still use symbol indexing to refer to DUPOK symbols defined in another object file. Today, this would already be useful for cutting down redundant type descriptors for anonymous types and method wrappers; but it's likely to be useful for avoiding time spent compiling redundant instantiations of generic functions/types too.

/cc @cherrymui

@mdempsky mdempsky added this to the Go1.18 milestone Jul 28, 2021
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 30, 2021
@cherrymui
Copy link
Member

Punt to 1.19.

@cherrymui cherrymui modified the milestones: Go1.18, Go1.19 Nov 11, 2021
@thanm thanm modified the milestones: Go1.19, Go1.20 May 11, 2022
@thanm
Copy link
Contributor

thanm commented May 11, 2022

Punting to 1.20, this is not going to be resolved in 1.19.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
@aclements
Copy link
Member

Moving to backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Triage Backlog
Development

No branches or pull requests

6 participants