[PATCH] D83469: [LLD][ELF] - Allow relocation sections to appear before their target sections.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 03:48:21 PDT 2020


jhenderson added a comment.

Looks fine to me, just comments that need updating.



================
Comment at: lld/ELF/InputFiles.cpp:644
 
-  // This block handles SHF_LINK_ORDER.
+  // We have the second loop. It is used to:
+  // 1) handle SHF_LINK_ORDER sections.
----------------
the -> a


================
Comment at: lld/ELF/InputFiles.cpp:646
+  // 1) handle SHF_LINK_ORDER sections.
+  // 2) create SHT_REL[A] sections. In a specific case it might be possible
+  // to have a relocatable section that follows the corresponding relocation
----------------
I would say "create SHT_REL[A} sections. In some cases relocated sections may follow the corresponding relocation section. In such a case, the relocation section would attempt to reference a target section that has not yet been created. For simplicity, delay creation of relocation sections until now."


================
Comment at: lld/ELF/InputFiles.cpp:656
+
+    // Create SHT_REL[A] sections.
+    if (sec.sh_type == SHT_REL || sec.sh_type == SHT_RELA)
----------------
I think this comment is probably superfluous - the code is simple enough to show it.


================
Comment at: lld/ELF/InputFiles.cpp:660
+
+    // This block handles SHF_LINK_ORDER.
     if (!(sec.sh_flags & SHF_LINK_ORDER))
----------------
I think you can delete this comment. It's fairly obvious that the rest is to do with SHF_LINK_ORDER, owing to the if statement.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83469/new/

https://reviews.llvm.org/D83469





More information about the llvm-commits mailing list