summaryrefslogtreecommitdiff
path: root/Source/bindexplib.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-05 13:07:16 +0000
committerKitware Robot <kwrobot@kitware.com>2020-05-05 09:07:25 -0400
commitd3d53eefeeea5d3cf853f4591e318f3e4998bec0 (patch)
tree38978061ee03daec77fcc7690673114ef115451b /Source/bindexplib.cxx
parent6a5daced189241b6dca9ee43de9f60d826f4c568 (diff)
parentbe75622e49614fcb96e99316f7a6e8a438538e7f (diff)
downloadcmake-d3d53eefeeea5d3cf853f4591e318f3e4998bec0.tar.gz
Merge topic 'remove_cli__symbols'
be75622e49 bindexplib: Do not export symbols from managed code Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4692
Diffstat (limited to 'Source/bindexplib.cxx')
-rw-r--r--Source/bindexplib.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index 4a5c641ce2..8435740139 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -276,8 +276,9 @@ public:
symbol.compare(0, 4, vectorPrefix)) {
SectChar = this->SectionHeaders[pSymbolTable->SectionNumber - 1]
.Characteristics;
- // skip symbols containing a dot
- if (symbol.find('.') == std::string::npos) {
+ // skip symbols containing a dot or are from managed code
+ if (symbol.find('.') == std::string::npos &&
+ !SymbolIsFromManagedCode(symbol)) {
if (!pSymbolTable->Type && (SectChar & IMAGE_SCN_MEM_WRITE)) {
// Read only (i.e. constants) must be excluded
this->DataSymbols.insert(symbol);
@@ -302,6 +303,13 @@ public:
}
private:
+ bool SymbolIsFromManagedCode(std::string const& symbol)
+ {
+ return symbol == "__t2m" || symbol == "__m2mep" || symbol == "__mep" ||
+ symbol.find("$$F") != std::string::npos ||
+ symbol.find("$$J") != std::string::npos;
+ }
+
std::set<std::string>& Symbols;
std::set<std::string>& DataSymbols;
DWORD_PTR SymbolCount;