[PATCH] D43439: [dsymutil] Skip DW_AT_sibling attributes.

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 18 06:47:20 PST 2018


JDevlieghere created this revision.
JDevlieghere added reviewers: aprantl, davide.

Following DW_AT_sibling attributes completely defeats the pruning pass.
Although we don't generate the DW_AT_sibling attribute we should still
handle it correctly.

This is also the reason I don't have a test case for this, I'm not sure how we
can test this without checking in a non-clang generated binary.


Repository:
  rL LLVM

https://reviews.llvm.org/D43439

Files:
  tools/dsymutil/DwarfLinker.cpp


Index: tools/dsymutil/DwarfLinker.cpp
===================================================================
--- tools/dsymutil/DwarfLinker.cpp
+++ tools/dsymutil/DwarfLinker.cpp
@@ -2556,7 +2556,8 @@
   for (const auto &AttrSpec : Abbrev->attributes()) {
     DWARFFormValue Val(AttrSpec.Form);
 
-    if (!Val.isFormClass(DWARFFormValue::FC_Reference)) {
+    if (!Val.isFormClass(DWARFFormValue::FC_Reference) ||
+        AttrSpec.Attr == dwarf::DW_AT_sibling) {
       DWARFFormValue::skipValue(AttrSpec.Form, Data, &Offset,
                                 Unit.getFormParams());
       continue;
@@ -2733,7 +2734,7 @@
                                         RefUnit);
 
   // If the referenced DIE is not found,  drop the attribute.
-  if (!RefDie)
+  if (!RefDie || AttrSpec.Attr == dwarf::DW_AT_sibling)
     return 0;
 
   unsigned Idx = RefUnit->getOrigUnit().getDIEIndex(RefDie);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43439.134833.patch
Type: text/x-patch
Size: 889 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180218/3e34aa0b/attachment.bin>


More information about the llvm-commits mailing list