[PATCH] D40553: [LLD] [COFF] Don't export symbols that have corresponding __imp_ symbols
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 28 14:01:21 PST 2017
ruiu added inline comments.
================
Comment at: COFF/MinGW.cpp:103-109
+ // Don't export anything that looks like an import symbol (which also can be
+ // a manually defined data symbol with such a name).
+ if (Sym->getName().startswith("__imp_"))
+ return false;
+ // If a corresponding __imp_ symbol exists and is defined, don't export it.
+ if (Symtab->find(("__imp_" + Sym->getName()).str()))
+ return false;
----------------
nit: add a blank line before each comment.
================
Comment at: COFF/MinGW.cpp:105-108
+ if (Sym->getName().startswith("__imp_"))
+ return false;
+ // If a corresponding __imp_ symbol exists and is defined, don't export it.
+ if (Symtab->find(("__imp_" + Sym->getName()).str()))
----------------
Don't you have to handle the i386 name mangling which is ___imp_ (triple underscores)?
https://reviews.llvm.org/D40553
More information about the llvm-commits
mailing list