This is an archive of the discontinued LLVM Phabricator instance.

Recognize BSS-only DATA segments as sections that need to be slid/loaded at addresses
ClosedPublic

Authored by jasonmolenda on Jun 28 2023, 7:11 PM.

Details

Summary

ObjectFileMachO::SetLoadAddress() takes a slide or base load address and applies the correct address difference to each section in the Target. It only makes these changes to "loadable" sections and one of the heuristics incorrectly disqualified a DATA segment that has no on-disk content, e.g. a BSS-only DATA segment. A DATA segment is allowed to have no file size; this is a small patch to SectionIsLoadable to recognize that. And add a quick test case.

Diff Detail

Event Timeline

jasonmolenda created this revision.Jun 28 2023, 7:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2023, 7:11 PM
jasonmolenda requested review of this revision.Jun 28 2023, 7:11 PM
This revision is now accepted and ready to land.Jun 29 2023, 5:09 PM