diff options
Diffstat (limited to 'Source/bindexplib.cxx')
-rw-r--r-- | Source/bindexplib.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx index 0b2750d..8435740 100644 --- a/Source/bindexplib.cxx +++ b/Source/bindexplib.cxx @@ -64,7 +64,7 @@ */ #include "bindexplib.h" -#include <cstddef> +#include <cstddef> // IWYU pragma: keep #include <sstream> #include <vector> @@ -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; @@ -352,14 +360,14 @@ bool DumpFileWithLlvmNm(std::string const& nmPath, const char* filename, line.c_str()); return false; } - const std::string sym = line.substr(0, sym_end); const char sym_type = line[sym_end + 1]; + line.resize(sym_end); switch (sym_type) { case 'D': - dataSymbols.insert(sym); + dataSymbols.insert(line); break; case 'T': - symbols.insert(sym); + symbols.insert(line); break; } } |