This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Add 32-bit compact unwind support
ClosedPublic

Authored by int3 on Apr 2 2021, 4:57 PM.

Details

Summary

This could probably have been part of D99633, but I split it up to make
things a bit more reviewable. I also fixed some bugs in the implementation that
were masked through integer underflows when operating in 64-bit mode.

Diff Detail

Event Timeline

int3 created this revision.Apr 2 2021, 4:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2021, 4:57 PM
int3 requested review of this revision.Apr 2 2021, 4:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2021, 4:57 PM
int3 added inline comments.Apr 2 2021, 5:00 PM
lld/MachO/UnwindInfoSection.cpp
210

Taking the address difference here doesn't make sense since at this point in the link, personality contains an index, not a real address (see the comments on lines 189-191 above.)

445

this is the right place to be taking the offset from the header.

gkm accepted this revision.Apr 12 2021, 2:39 PM
gkm added a subscriber: gkm.

LGTM

lld/MachO/UnwindInfoSection.cpp
121
139–140

I will skip the many similar edit suggestions for sake of time. You get the idea.

422–424
527–529
This revision is now accepted and ready to land.Apr 12 2021, 2:39 PM
int3 added inline comments.Apr 12 2021, 6:15 PM
lld/MachO/UnwindInfoSection.cpp
121

what is 'P' supposed to stand for? Maybe 'CPE' instead?

int3 added inline comments.Apr 12 2021, 6:29 PM
lld/MachO/UnwindInfoSection.cpp
121

I meant CUE

int3 added inline comments.Apr 12 2021, 9:06 PM
lld/MachO/UnwindInfoSection.cpp
121

Oh, I see -- you mean to parameterize things by the word size rather than the struct. That makes sense...

int3 updated this revision to Diff 337038.Apr 12 2021, 9:12 PM

change template param

This revision was landed with ongoing or failed builds.Apr 13 2021, 7:44 AM
This revision was automatically updated to reflect the committed changes.