Skip to content

Stop marking reflection metadata sections as 'no_dead_strip' on Darwin #41224

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

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

kubamracek
Copy link
Contributor

I'm trying to expand dead-strippability to reflection metadata, part of the solution is #40853, this is another part -- currently IRGen marks all reflection metadata sections as 'no_dead_strip' (with a Darwin linker specific attribute). This seems unnecessarily conservative, and there seems to be no good reason why we need these entire sections to opt out of dead-strippability: The globals should either be "alive" (referenced by other globals/code), or if there's situations where there's actually a un-referenced global that still needs to survive into final binaries, we should use llvm.used on that particular global. Furthermore, we already do not use the equivalent of a section-wide dead-strippability opt-out for non-Mach-O targets, and also I tried to dig up why 'no_dead_strip' was added in git history, but I couldn't find anything -- seems like this has always been that way, with no explanation why.

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@jckarter
Copy link
Contributor

jckarter commented Feb 7, 2022

Should be safe to do this now. Thanks Kuba!

@kubamracek kubamracek merged commit 5f3489d into main Feb 7, 2022
@kubamracek kubamracek deleted the dont-nodeadstrip-refl-sections branch February 7, 2022 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants