This is an archive of the discontinued LLVM Phabricator instance.

[lld/mac] Add explicit "no unwind info" entries for functions without unwind info
ClosedPublic

Authored by thakis on Jun 21 2021, 7:31 PM.

Details

Summary

Fixes PR50529. With this, lld-linked Chromium base_unittests passes on arm macs.

Surprisingly, no measurable impact on link time.

Diff Detail

Event Timeline

thakis created this revision.Jun 21 2021, 7:31 PM
Herald added a reviewer: gkm. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
thakis requested review of this revision.Jun 21 2021, 7:31 PM
thakis updated this revision to Diff 353532.Jun 21 2021, 7:34 PM

upload correct diff

thakis updated this revision to Diff 353538.Jun 21 2021, 8:06 PM

clang-format

thakis updated this revision to Diff 353541.Jun 21 2021, 8:24 PM

more explicit test (_quux behavior matches ld64)

int3 accepted this revision.Jun 21 2021, 10:31 PM

Thanks!

lld/MachO/UnwindInfoSection.cpp
284

worth adding a comment about why we need this

300–302

I think this might not be necessary given that as far as code section symbols go, all of them can be found as we loop over in objFile->symbols below (supposing we remove the !isExternal() check). I think the SymtabSection loops over the symbol table only to ensure we emit the synthetic symbols

This revision is now accepted and ready to land.Jun 21 2021, 10:31 PM
thakis marked an inline comment as done.Jun 22 2021, 3:12 AM

Thanks!

lld/MachO/UnwindInfoSection.cpp
300–302

It's also so we don't emit weak symbols that are in many files more than once. We already dedup'd them via the symbol table, might as well re-use that work.

Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2021, 3:12 AM