-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[ObjC][Gen] Emit strs into __cstring if willBeRelativelyAddressed #84661
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
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.
We've definitely run into that linker bug before, which is why the flag exists, so I'm fine with this.
I've requested membership, but I don't have it yet. @rjmccall could you test and merge for me? |
@swift-ci Please test |
@swift-ci Please test macOS platform |
ba43f96
to
de6e7f0
Compare
@swift-ci Please test |
de6e7f0
to
0a95e71
Compare
@swift-ci Please test |
|
@swift-ci please test macOS |
@swift-ci please test Windows |
…jc-cstr-sections Rebase past swiftlang#84708
Oops, I thought I had to rebase and then retest. I'll trigger the tests again |
@swift-ci Please test |
@swift-ci please test Windows |
Emit ObjC strings to the
__cstring
section ifwillBeRelativelyAddressed
is true.#84300 recently emitted these special strings into their respective sections. However, I recently discovered an error when linking an x86_64 binary.
I believe the issue is there is a relocation that has an offset (
-4
in this case) outside of the referent section (__objc_classname
). After looking at 638e4b0 and 50b5044, I suspect they are a similar issues.These cases already set
willBeRelativelyAddressed
, so if that's the case, also make sure they are emitted into the__cstring
section.