[PATCH] D18691: [ELF] - Split Writer::assignAddresses(): extract code for initializing dummies sections to fixDummiesSections()

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 1 09:27:55 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/Writer.cpp:1388
@@ +1387,3 @@
+template <class ELFT> void Writer<ELFT>::fixDummiesSections() {
+  Out<ELFT>::ElfHeader->setSize(sizeof(Elf_Ehdr));
+  size_t PhdrSize = sizeof(Elf_Phdr) * Phdrs.size();
----------------
This line does not depend on any data we have created until the control reaches this point. Move this to writeResult.

================
Comment at: ELF/Writer.cpp:1389-1390
@@ +1388,4 @@
+  Out<ELFT>::ElfHeader->setSize(sizeof(Elf_Ehdr));
+  size_t PhdrSize = sizeof(Elf_Phdr) * Phdrs.size();
+  Out<ELFT>::ProgramHeaders->setSize(PhdrSize);
+}
----------------
Then you can move this at end of createPhdrs.


http://reviews.llvm.org/D18691





More information about the llvm-commits mailing list