diff options
author | Markus Mayer <markus.mayer@brainlab.com> | 2020-04-30 10:53:50 (GMT) |
---|---|---|
committer | Markus Mayer <markus.mayer@brainlab.com> | 2020-05-04 07:58:09 (GMT) |
commit | be75622e49614fcb96e99316f7a6e8a438538e7f (patch) | |
tree | 259dcb3088d77c3b452d6b39b0269c735236207c /Source/bindexplib.cxx | |
parent | 2291253c1ba2f2f5f8192ba283f8291b9b6ea24f (diff) | |
download | CMake-be75622e49614fcb96e99316f7a6e8a438538e7f.zip CMake-be75622e49614fcb96e99316f7a6e8a438538e7f.tar.gz CMake-be75622e49614fcb96e99316f7a6e8a438538e7f.tar.bz2 |
bindexplib: Do not export symbols from managed code
Fixes: #20653
Diffstat (limited to 'Source/bindexplib.cxx')
-rw-r--r-- | Source/bindexplib.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx index fdfd4c0..9125965 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; |