[PATCH] D40235: COFF: Correctly handle relocations against early discarded sections.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 20 02:04:06 PST 2017


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lld/COFF/Chunks.cpp:271
         continue;
-      fatal("relocation against symbol in discarded section: " +
-            Sym->getName());
+      COFFSymbolRef Sym =
+          check(File->getCOFFObj()->getSymbol(Rel.SymbolTableIndex));
----------------
If you move this piece of code immediately after `auto *Sym = dyn_cast_or_null..`, can't you simplify code a bit? You would have to write two `fatal` function calls with the same message, but I don't think that's not that bad.


https://reviews.llvm.org/D40235





More information about the llvm-commits mailing list