summaryrefslogtreecommitdiffstats
path: root/Source/bindexplib.cxx
diff options
context:
space:
mode:
authorZsolt Parragi <zsolt.parragi@cancellar.hu>2017-02-24 09:06:43 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-28 14:49:12 (GMT)
commit85e08370d0774397f42a7d45d07f22b3a817fe10 (patch)
tree65eaf7954bcbb864c1bbe3076294561b0832e7cf /Source/bindexplib.cxx
parent78104bd7bca4bd9b4b7a5c17622838a33843138e (diff)
downloadCMake-85e08370d0774397f42a7d45d07f22b3a817fe10.zip
CMake-85e08370d0774397f42a7d45d07f22b3a817fe10.tar.gz
CMake-85e08370d0774397f42a7d45d07f22b3a817fe10.tar.bz2
bindexplib: Always export executable symbols, even they are also readable
Previously bindexplib discarded read-only non-function symbols even in executable/code sections, but in some specific cases they could still mark functions. An example is provided by nop.asm in the AuoExportDll test, which exports a function only marked by a label. This symbol can be used from C/C++ code, but without this change it would result in an unresolved external symbol when built as a DLL on Windows.
Diffstat (limited to 'Source/bindexplib.cxx')
-rw-r--r--Source/bindexplib.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index eded883..e41850a 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -308,7 +308,8 @@ public:
this->DataSymbols.insert(symbol);
} else {
if ( pSymbolTable->Type ||
- !(SectChar & IMAGE_SCN_MEM_READ)) {
+ !(SectChar & IMAGE_SCN_MEM_READ) ||
+ (SectChar & IMAGE_SCN_MEM_EXECUTE)) {
this->Symbols.insert(symbol);
} else {
// printf(" strange symbol: %s \n",symbol.c_str());