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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 15 15:32:31 PDT 2016


ruiu added a comment.

How did you know that FreeBSD's linker scripts depend on this behavior?

If you think the new behavior you are implementing in this patch simpler than the current one, why don't you just replace it with the new one, instead of keeping two different functions?


================
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);
----------------
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?


https://reviews.llvm.org/D23505





More information about the llvm-commits mailing list