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 · 2 comments
Open

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

mdempsky opened this issue Jul 28, 2021 · 2 comments
Labels
FeatureRequest NeedsInvestigation
Milestone

Comments

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Jul 28, 2021

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 label Jul 30, 2021
@cherrymui
Copy link
Member

@cherrymui cherrymui commented Nov 11, 2021

Punt to 1.19.

@cherrymui cherrymui removed this from the Go1.18 milestone Nov 11, 2021
@cherrymui cherrymui added this to the Go1.19 milestone Nov 11, 2021
@thanm thanm removed this from the Go1.19 milestone May 11, 2022
@thanm thanm added this to the Go1.20 milestone May 11, 2022
@thanm
Copy link
Contributor

@thanm thanm commented May 11, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

4 participants