[PATCH] D23505: [ELF] - Linkrscript: change the way of creating PT_LOADs segments when LS is used.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 00:48:50 PDT 2016


grimar added inline comments.

================
Comment at: ELF/Writer.cpp:968
@@ +967,3 @@
+    uintX_t NewFlags = Sec->getPhdrFlags();
+    if (((Load->H.p_flags & PF_W) == 0) && ((NewFlags & PF_W) != 0))
+      Load = addHdr(Dest, PT_LOAD, NewFlags);
----------------
ruiu wrote:
> What if the current section is writable and NewFlags are not writable? This code seems to merge them, but is it the right thing to do?
That is what ld do. I think it is fine because writable sections go after all other ones. 
At least it is assumed they should.


https://reviews.llvm.org/D23505





More information about the llvm-commits mailing list