[PATCH] D40014: [LLD] [COFF] Improve the autoexport check for symbols from import libraries with -opt:noref

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 14:19:38 PST 2017


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

lgtm, definitely don't want to auto-export that imported data. The absolute symbol thing can be a follow-up change.



================
Comment at: COFF/MinGW.cpp:94
     return false;
+  if (!isa<DefinedRegular>(Sym) && !isa<DefinedCommon>(Sym))
+    return false;
----------------
These are the Defined symbol kinds:
    DefinedRegularKind = 0,
    DefinedCommonKind,
    DefinedLocalImportKind,
    DefinedImportThunkKind,
    DefinedImportDataKind,
    DefinedAbsoluteKind,
    DefinedSyntheticKind,

I can't think of any synthetic symbols that we'd want to auto-export, but it's definitely possible to define an absolute symbol in an object file that should be auto-exported, right? The linker-generated absolute symbols will probably fail the getFile() null check below.


https://reviews.llvm.org/D40014





More information about the llvm-commits mailing list