From 347efdedd5db5b7a05115ae334ec35d03ef76516 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Sat, 11 Mar 2006 09:47:41 -0500 Subject: [PATCH] ENH: Also look into data segment (consistant with other implementation) --- Source/kwsys/DynamicLoader.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/kwsys/DynamicLoader.cxx b/Source/kwsys/DynamicLoader.cxx index 07df87a43..a2426b917 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.