This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Fix __objc_stubs ordering
ClosedPublic

Authored by keith on Dec 12 2022, 8:47 PM.

Details

Reviewers
int3
Group Reviewers
Restricted Project
Commits
rG3a8c6a3039af: [lld-macho] Fix __objc_stubs ordering
Summary

In the case of large binaries previously you could end up getting
relocation failures. This mirrors ld64's ordering of these sections. I'm
not sure this solves all cases but it should help in some.

Fixes https://github.com/llvm/llvm-project/issues/58298

Diff Detail

Event Timeline

keith created this revision.Dec 12 2022, 8:47 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 12 2022, 8:48 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
keith requested review of this revision.Dec 12 2022, 8:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2022, 8:48 PM
keith updated this revision to Diff 482355.Dec 12 2022, 9:02 PM

Fix test addrs

int3 accepted this revision.Dec 12 2022, 10:00 PM
int3 added a subscriber: int3.

Thanks!

lld/test/MachO/x86-64-objc-stubs.s
24–28

Ideally the test would've been written using substitutions instead of hardcoded addresses so we don't have this churn. It would probably also make the test more comprehensive. See start-end.s line 102 for an example of how to test RIP-relative addresses. I'm fine with this being done in some future commit though :)

This revision is now accepted and ready to land.Dec 12 2022, 10:00 PM
keith updated this revision to Diff 482541.Dec 13 2022, 10:11 AM
keith marked an inline comment as done.

Make tests address independent

keith added inline comments.Dec 13 2022, 10:12 AM
lld/test/MachO/x86-64-objc-stubs.s
24–28

Updated these and verified they passed before and after. because of that maybe they're a bit less strict than they could be

This revision was automatically updated to reflect the committed changes.