[PATCH] D155659: [WPD][LLD] Add option to validate RTTI is enabled on all native types and prevent devirtualization on types with native RTTI

Di Mo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 23:17:45 PDT 2023


modimo added inline comments.


================
Comment at: lld/ELF/Driver.cpp:1038
+  for (InputFile *f : ctx.objectFiles) {
+    for (Symbol *sym : f->getSymbols()) {
+      processVtableAndTypeInfoSymbols(sym->getName());
----------------
tejohnson wrote:
> Does this get both defs and refs? I think the latter as I am seeing a case where we are linking a bitcode object that contains both the vtable and typename defs but are disabling --lto-whole-program-visibility, and the reason seems to be a reference to the vtable from a native object.
>Does this get both defs and refs?
This goes through the entirety of .symtab so both defs and refs.

>I think the latter as I am seeing a case where we are linking a bitcode object that contains both the vtable and typename defs but are disabling --lto-whole-program-visibility, and the reason seems to be a reference to the vtable from a native object.

Mocking up a forward class declaration in the native object where the definition is in bitcode I see --lto-whole-program-visibility get disabled. Only looking at vtable defs makes sense, I'll make the change and add a test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155659



More information about the llvm-commits mailing list