[PATCH] D15423: [ELF] - Place RW sections that go after relro to another memory page.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 22:29:43 PST 2015


ruiu added inline comments.

================
Comment at: ELF/Writer.cpp:855
@@ -852,2 +854,3 @@
 template <class ELFT>
-void Writer<ELFT>::updateRelro(Elf_Phdr *Cur, Elf_Phdr *GnuRelroPhdr,
+bool Writer<ELFT>::isRelroEnded(Elf_Phdr *Cur, Elf_Phdr *RelroPhdr,
+                                OutputSectionBase<ELFT> *Sec) {
----------------
Can you rename this isFirstNonRelroSection? I think it conveys the meaning better.

================
Comment at: ELF/Writer.cpp:859
@@ +858,3 @@
+    return false;
+  return RelroPhdr->p_type;
+}
----------------
Please add that as a comment.

  // p_type is zero if we have not created RELRO PHDR yet.

================
Comment at: ELF/Writer.cpp:901
@@ -891,1 +900,3 @@
+  Elf_Phdr RelroPhdr = {};
+  bool RelroAligned = false;
   Elf_Phdr TlsPhdr{};
----------------
Do you need this boolean variable? Because of the p_type check, I think isRelroEnded returns true only once.


http://reviews.llvm.org/D15423





More information about the llvm-commits mailing list