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

mdempsky opened this issue Jul 28, 2021 · 0 comments

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

mdempsky opened this issue Jul 28, 2021 · 0 comments


Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants