summaryrefslogtreecommitdiffstats
path: root/Source/bindexplib.cxx
diff options
context:
space:
mode:
authorMikhail Paulyshka <me@mixaill.tk>2017-04-25 21:37:37 (GMT)
committerMikhail Paulyshka <me@mixaill.tk>2017-04-26 19:23:33 (GMT)
commitafb21342ead475a12636f29f7cd77cbe38d05ed1 (patch)
tree6642685529fb584cec268858e520540bbd1a267a /Source/bindexplib.cxx
parent959ad1d5e8bbd07b4111630c347ca3d69353f48b (diff)
downloadCMake-afb21342ead475a12636f29f7cd77cbe38d05ed1.zip
CMake-afb21342ead475a12636f29f7cd77cbe38d05ed1.tar.gz
CMake-afb21342ead475a12636f29f7cd77cbe38d05ed1.tar.bz2
bindexplib: fix constants symbols export
Diffstat (limited to 'Source/bindexplib.cxx')
-rw-r--r--Source/bindexplib.cxx32
1 files changed, 13 insertions, 19 deletions
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index 6026a57..691e3ae 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -235,35 +235,29 @@ public:
symbol.erase(posAt);
}
}
- // For i386 builds we don't need to remove _
+ // For i386 builds we need to remove _
if (this->IsI386 && symbol[0] == '_') {
symbol.erase(0, 1);
}
- /*
- Check whether it is "Scalar deleting destructor" and
- "Vector deleting destructor"
- */
+ // Check whether it is "Scalar deleting destructor" and "Vector
+ // deleting destructor"
+ // if scalarPrefix and vectorPrefix are not found then print the
+ // symbol
const char* scalarPrefix = "??_G";
const char* vectorPrefix = "??_E";
- // original code had a check for
- // symbol.find("real@") == std::string::npos)
- // but if this disallows memmber functions with the name real
- // if scalarPrefix and vectorPrefix are not found then print
- // the symbol
if (symbol.compare(0, 4, scalarPrefix) &&
symbol.compare(0, 4, vectorPrefix)) {
SectChar = this->SectionHeaders[pSymbolTable->SectionNumber - 1]
.Characteristics;
- if (!pSymbolTable->Type && (SectChar & IMAGE_SCN_MEM_WRITE)) {
- // Read only (i.e. constants) must be excluded
- this->DataSymbols.insert(symbol);
- } else {
- if (pSymbolTable->Type || !(SectChar & IMAGE_SCN_MEM_READ) ||
- (SectChar & IMAGE_SCN_MEM_EXECUTE)) {
- this->Symbols.insert(symbol);
- } else {
- // printf(" strange symbol: %s \n",symbol.c_str());
+
+ if (SectChar & IMAGE_SCN_MEM_EXECUTE) {
+ this->Symbols.insert(symbol);
+ } else if (SectChar & IMAGE_SCN_MEM_READ) {
+ // skip __real@ and __xmm@
+ if (symbol.find("_real") == std::string::npos &&
+ symbol.find("_xmm") == std::string::npos) {
+ this->DataSymbols.insert(symbol);
}
}
}