[PATCH] D90200: [ELF] -r: don't crash when a non-SHF_LINK_ORDER orphan is added before a SHF_LINK_ORDER orphan

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 00:06:20 PDT 2020


grimar added inline comments.


================
Comment at: lld/ELF/LinkerScript.cpp:693
               ->sectionBases[0]);
-      if (firstIsec->getLinkOrderDep()->getOutputSection() !=
-          isec->getLinkOrderDep()->getOutputSection())
+      auto *firstIsecOut =
+          firstIsec->flags & SHF_LINK_ORDER
----------------
Probably you shouldn't use `auto`, because the return type is not obvious here.


================
Comment at: lld/test/ELF/linkorder-mixed2.s:12
+
+# CHECK: 0100
+
----------------
I'd add the `Hex dump of section 'foo'` check line and used `CHECK-NEXT` for this one, just in case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90200



More information about the llvm-commits mailing list