[PATCH] D17817: [ELF] do not allow .bss to occupy the file space when producing relocatable output.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 3 01:59:55 PST 2016


grimar added inline comments.

================
Comment at: ELF/Writer.cpp:1325
@@ -1324,1 +1324,3 @@
+      FileOff = alignTo(FileOff, Sec->getAlign());
     Sec->setFileOffset(FileOff);
+    if (Sec->getType() != SHT_NOBITS)
----------------
We just do the same in assignAddresses():


```
    if (Sec->getType() != SHT_NOBITS)
      FileOff = alignTo(FileOff, Align);
    Sec->setFileOffset(FileOff);
    if (Sec->getType() != SHT_NOBITS)
      FileOff += Sec->getSize();
```


http://reviews.llvm.org/D17817





More information about the llvm-commits mailing list