-
Notifications
You must be signed in to change notification settings - Fork 10.5k
IRGen: Rename the section pointing to rodata of generic classes to __objc_clsrolist #74178
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
Conversation
…objc_clsrolist Also emit it per default. rdar://129299739
@swift-ci test |
llvm::GlobalValue::InternalLinkage, Int8PtrTy, /*isConstant*/ false, | ||
/*asContiguousArray*/ true, /*canBeStrippedByLinker*/ true); | ||
/*asContiguousArray*/ true, /*canBeStrippedByLinker*/ false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/canBeStrippedByLinker/ false
Is this about the symbol name or dead code stripping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This boolean decides whether llvm.used or llvm.compiler.used is used.
This will influence whether llvm's LTO can assume that the variable is unused if there are no other uses (that would happen with llvm.compiler.used
i.e /canBeStrippedByLinker/ true) but will also cause the emission of .no_dead_strip _generic_ro_datas
.
As in:
.section __LD,__objc_clsrolist
.p2align 3, 0x0
_generic_ro_datas:
.quad ___unnamed_1+40
.quad ___unnamed_1+112
...
.no_dead_strip _generic_ro_datas
I assumed that is okay since the linker will know it is to remove that section at the point it uses it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, right we need this for LTO. It means older linkers that don't know about the section won't be able to dead strip it. That's maybe fine though? I assume this won't be too big, and it's only a problem when building with new Swift compiler but using an older linker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will be one entry per generic class definition. Yes, I assume this to be a marginal problem that if it turns out to be a problem for an individual project that uses a new compiler with an old linker can turn this off via compiler flags.
IRGen: Rename the section pointing to rodata of generic classes to __objc_clsrolist
IRGen: Rename the section pointing to rodata of generic classes to __objc_clsrolist
IRGen: Rename the section pointing to rodata of generic classes to __objc_clsrolist
Also emit it per default.
rdar://129299739