[PATCH] D105750: [not for review][lld-macho] Set allEntriesAreOmitted correctly for unwind info from ld -r

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 9 15:46:15 PDT 2021


int3 created this revision.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
Herald added a reviewer: lld-macho.
int3 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105750

Files:
  lld/MachO/UnwindInfoSection.cpp


Index: lld/MachO/UnwindInfoSection.cpp
===================================================================
--- lld/MachO/UnwindInfoSection.cpp
+++ lld/MachO/UnwindInfoSection.cpp
@@ -168,9 +168,14 @@
     assert(target->hasAttr(r.type, RelocAttrBits::UNSIGNED));
 
     if (r.offset % sizeof(CompactUnwindEntry<Ptr>) == 0) {
-      if (auto *referentIsec = r.referent.dyn_cast<InputSection *>())
-        if (!cast<ConcatInputSection>(referentIsec)->shouldOmitFromOutput())
-          allEntriesAreOmitted = false;
+      InputSection *referentIsec;
+      if (auto *isec = r.referent.dyn_cast<InputSection *>())
+        referentIsec = isec;
+      else
+        referentIsec = cast<Defined>(r.referent.dyn_cast<Symbol *>())->isec;
+
+      if (!cast<ConcatInputSection>(referentIsec)->shouldOmitFromOutput())
+        allEntriesAreOmitted = false;
       continue;
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105750.357659.patch
Type: text/x-patch
Size: 876 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210709/174a2681/attachment-0001.bin>


More information about the llvm-commits mailing list