[PATCH] D25627: [ELF] Convert linker generated sections to input sections

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 17:15:03 PDT 2016


ruiu added a comment.

Overall, this is towards the right direction. Please rebase on SVN head because Rafael made a few changes that you can use in this patch.



================
Comment at: ELF/Writer.cpp:780
+  for (SyntheticInputSection<ELFT> *S : In<ELFT>::Sections)
+    if (S && S->needed())
+      addInputSec(S);
----------------
Remove null check. Sections shouldn't contain a nullptr.


================
Comment at: ELF/Writer.cpp:869
+      S->finalize();
+      S->OutSec->assignOffsets();
+    }
----------------
Why do you have to call S->Outsec->assignOffsets?


================
Comment at: ELF/Writer.cpp:1495
 template <class ELFT> void Writer<ELFT>::writeBuildId() {
-  if (!Out<ELFT>::BuildId)
+  if (!In<ELFT>::BuildId || !In<ELFT>::BuildId->OutSec)
     return;
----------------
You want to use needed() for consistency.


https://reviews.llvm.org/D25627





More information about the llvm-commits mailing list