This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] place __TEXT,__stubs before __TEXT,__text
Changes PlannedPublic

Authored by gkm on May 9 2021, 12:25 AM.

Details

Reviewers
int3
Group Reviewers
Restricted Project
Summary

The thunk placement algorithm is better (lower cost, better results) when stubs immediatelly precedes text.

Also, when stubs comes first AND PGO/FDO places hot code at the front of text, then stubs are reachable without thunks from low __text addresses.

The test cases now work with either layout.

Diff Detail

Event Timeline

gkm created this revision.May 9 2021, 12:25 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: wenlei. · View Herald Transcript
gkm requested review of this revision.May 9 2021, 12:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2021, 12:25 AM
int3 requested changes to this revision.May 9 2021, 2:27 PM

IMO we should try to hew to ld64's output for now; once we're sure we have general compatibility we can come back and tweak things like these

This revision now requires changes to proceed.May 9 2021, 2:27 PM
gkm planned changes to this revision.May 9 2021, 3:30 PM