[PATCH] D54723: [COFF] Add exported functions to gfids table for /guard:cf

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 26 17:48:03 PST 2018


rnk marked an inline comment as done.
rnk added a comment.

Thanks, landing soon.



================
Comment at: lld/COFF/Writer.cpp:1371
   if (Config->Entry)
-    addSymbolToRVASet(AddressTakenSyms, cast<Defined>(Config->Entry));
+    maybeAddAddressTakenFunction(AddressTakenSyms, Config->Entry);
+
----------------
alex wrote:
> In the case where `Config->Entry` is a `Defined`, but not a `DefinedCOFF`, it won't get added with this patch, whereas it would have before. Can that situation happen?
(one week later, after the holidays...) So, it looks like that situation can happen. The one I came up with was import thunks. They can be exported, entry points, and address taken, although it's a bit ridiculous to import an export, or use an imported symbol as your entry point.

However, it's a pre-existing issue in the relocation scanning code. Even though it's a behavior change for entry point symbols, I think making them both have the same bug is actually somewhat better. I filed this bug for it: https://bugs.llvm.org/show_bug.cgi?id=39799


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

https://reviews.llvm.org/D54723





More information about the llvm-commits mailing list