[PATCH] D24795: [ELF] Linkerscript: Try to put section to the last PT_LOAD, in case there is no exact segment specification

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 21 07:53:04 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/LinkerScript.cpp:617-621
@@ -615,4 +616,7 @@
       uintX_t NewFlags = Sec->getPhdrFlags();
-      if (Load == nullptr || Flags != NewFlags) {
-        Load = &*Ret.emplace(Ret.end(), PT_LOAD, NewFlags);
-        Flags = NewFlags;
+      uintX_t Flags = 0;
+      if (LoadId != UINT_MAX)
+        Flags = Opt.PhdrsCommands[LoadId].Flags == UINT_MAX
+                    ? UINT_MAX
+                    : Ret[LoadId].H.p_flags;
+
----------------
I do not understand what this code does. Can you elaborate?


Repository:
  rL LLVM

https://reviews.llvm.org/D24795





More information about the llvm-commits mailing list