[PATCH] D49366: Add support for /FUNCTIONPADMIN command-line option

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 18 10:27:49 PDT 2018


pcc added inline comments.


================
Comment at: COFF/Writer.cpp:761
+      if ((Padding != 0) && dyn_cast<SectionChunk>(C)) {
+        RawSize += Padding;
+        VirtualSize += Padding;
----------------
stefan_reinalter wrote:
> pcc wrote:
> > Taking a closer look at the code, it looks like `RawSize` is updated automatically at the end of the loop, so you don't need to update it here.
> Can we assume that C->hasData() is always true in this case?
As it happens it should always be true for chunks in the text section (what it means is that the section is not uninitialized data, i.e. bss) but even in the case where it weren't true we wouldn't want to change `RawSize` because that variable contains the amount of initialized data in the section and it shouldn't be affected by any uninitialized data sections.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D49366





More information about the llvm-commits mailing list