[PATCH] D116092: [XCOFF] make sure same number of paddings are added

Esme Yi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 18:23:39 PDT 2022


Esme added a comment.

I don't think a non-NFC patch should be missing tests, how about making D114419 <https://reviews.llvm.org/D114419> to the parent of this patch and leaving an error check there to be fixed in this patch?



================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:1095
+      LastDwarfSection = &DwarfSection;
+    }
+  }
----------------
simplify the if-else to 

```
  if (LastDwarfSection)
    LastDwarfSection->MemorySize =
        DwarfSection.Address - LastDwarfSection->Address;
  LastDwarfSection = &DwarfSection;
```


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:1098
+  if (LastDwarfSection) {
+    // Make the final DWARF section Address align to default section alignment
+    // for follow sections.
----------------



================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:1103
+    LastDwarfSection->MemorySize = Address - LastDwarfSection->Address;
   }
 
----------------
Why do you want the last Dwarf section to be aligned with the DefaultSectionAlign? It seems to me that it is followed by relocation and not sections, right?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116092/new/

https://reviews.llvm.org/D116092



More information about the llvm-commits mailing list