This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho][objc] Don't crash when rodata isn't statically linked
ClosedPublic

Authored by int3 on Mar 30 2023, 6:12 AM.

Details

Summary

We were previously assuming that to hold, but it appears that swiftc
may generate classes that link against __objc_empty_cache for their
rodata pointer.

This should allow us to re-land D142916: [lld-macho] Warn on method name collisions from category definitions (as a stack).

Diff Detail

Event Timeline

int3 created this revision.Mar 30 2023, 6:12 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 30 2023, 6:12 AM
int3 requested review of this revision.Mar 30 2023, 6:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2023, 6:12 AM
int3 added a subscriber: oontvoo.Mar 30 2023, 6:13 AM

@oontvoo wanna test this on the previous crashes you were seeing before I land it?

@oontvoo wanna test this on the previous crashes you were seeing before I land it?

yes - testing this now - give me ~2 hrs

P.S: Wait, this should be stacked on top of the previous patch, yes? (the one that supported emitting the warnings?)

int3 added a comment.Mar 30 2023, 7:53 AM

P.S: Wait, this should be stacked on top of the previous patch, yes? (the one that supported emitting the warnings?)

Yep that's right

oontvoo accepted this revision.Mar 30 2023, 8:29 AM

@oontvoo wanna test this on the previous crashes you were seeing before I land it?

yes - testing this now - give me ~2 hrs

P.S: Seems to work! (no longer saw the previous crash) 👍
Thanks!

This revision is now accepted and ready to land.Mar 30 2023, 8:29 AM
int3 added a comment.Mar 30 2023, 11:03 AM

Awesome!

Wanna stamp D147230 too? Otherwise you'll see spurious warnings when I land this :p

This revision was landed with ongoing or failed builds.Mar 30 2023, 11:33 AM
This revision was automatically updated to reflect the committed changes.