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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 14:05:07 PDT 2016


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM


================
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) {
----------------
Nice. I knew alignTo accepts the third argument, but this is the first time I see that is useful.


http://reviews.llvm.org/D19416





More information about the llvm-commits mailing list