[PATCH] D19416: [ELF] - Align sections file offsets correctly.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 01:25:11 PDT 2016


grimar added inline comments.

================
Comment at: ELF/Writer.cpp:1687-1694
@@ -1671,7 +1686,10 @@
+  return alignTo(Off, Target->PageSize, Sec->getVA());
+}
+
 // Assign file offsets to output sections.
 template <class ELFT> void Writer<ELFT>::assignFileOffsets() {
   uintX_t Off =
       Out<ELFT>::ElfHeader->getSize() + Out<ELFT>::ProgramHeaders->getSize();
 
   for (OutputSectionBase<ELFT> *Sec : OutputSections) {
     if (Sec->getType() == SHT_NOBITS) {
----------------
ruiu wrote:
> Nice. I knew alignTo accepts the third argument, but this is the first time I see that is useful.
Yeah, I also saw it, but it was completely not obvious for me that it can be replacement for what was wrote before.


http://reviews.llvm.org/D19416





More information about the llvm-commits mailing list