diff options
author | Albert Ziegenhagel <albert.ziegenhagel@scai.fraunhofer.de> | 2017-05-16 13:24:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-05-16 15:22:48 (GMT) |
commit | 8d754ad5e74a3b0edf3f6cb9ea2db6abf5cfec74 (patch) | |
tree | 80a60040c94bb11e6d09d3cda14c6d41a08554f0 /Source/bindexplib.cxx | |
parent | 1867856f6adb5d9743cfa28e7b10809e23dd0d51 (diff) | |
download | CMake-8d754ad5e74a3b0edf3f6cb9ea2db6abf5cfec74.zip CMake-8d754ad5e74a3b0edf3f6cb9ea2db6abf5cfec74.tar.gz CMake-8d754ad5e74a3b0edf3f6cb9ea2db6abf5cfec74.tar.bz2 |
bindexplib: Skip symbols containing a dot (.)
Symbols including a dot are not valid and result in a `LNK1242` error
when trying to create a library from the def file. Such symbols happen
to be in object files when using PGI Fortran on Windows and compiling
with debug symbols enabled. Those symbols do not need to be exported.
Diffstat (limited to 'Source/bindexplib.cxx')
-rw-r--r-- | Source/bindexplib.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx index 691e3ae..cd1fb8a 100644 --- a/Source/bindexplib.cxx +++ b/Source/bindexplib.cxx @@ -251,13 +251,16 @@ public: SectChar = this->SectionHeaders[pSymbolTable->SectionNumber - 1] .Characteristics; - 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); + // skip symbols containing a dot + if (symbol.find('.') == std::string::npos) { + 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); + } } } } |