summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2006-03-11 14:47:41 (GMT)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2006-03-11 14:47:41 (GMT)
commit347efdedd5db5b7a05115ae334ec35d03ef76516 (patch)
treee5c6ae613bbb27db2db9a197306dab562437018c /Source/kwsys
parent6f3ef5aa9287db076a155a50dffab8d2976dd6c6 (diff)
downloadCMake-347efdedd5db5b7a05115ae334ec35d03ef76516.zip
CMake-347efdedd5db5b7a05115ae334ec35d03ef76516.tar.gz
CMake-347efdedd5db5b7a05115ae334ec35d03ef76516.tar.bz2
ENH: Also look into data segment (consistant with other implementation)
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/DynamicLoader.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/kwsys/DynamicLoader.cxx b/Source/kwsys/DynamicLoader.cxx
index 07df87a..a2426b9 100644
--- a/Source/kwsys/DynamicLoader.cxx
+++ b/Source/kwsys/DynamicLoader.cxx
@@ -80,7 +80,11 @@ DynamicLoader::GetSymbolAddress(LibHandle lib, const char* sym)
void* addr;
int status;
- status = shl_findsym (&lib, sym, TYPE_PROCEDURE, &addr);
+ /* TYPE_PROCEDURE Look for a function or procedure.
+ * TYPE_DATA Look for a symbol in the data segment (for example, variables).
+ * TYPE_UNDEFINED Look for any symbol.
+ */
+ status = shl_findsym (&lib, sym, TYPE_UNDEFINED, &addr);
void* result = (status < 0) ? (void*)0 : addr;
// Hack to cast pointer-to-data to pointer-to-function.