Skip to content
Snippets Groups Projects
Commit 23d54d58 authored by Mathieu Malaterre's avatar Mathieu Malaterre
Browse files

ENH: Also look into data segment (consistant with other implementation)

parent 54a6c3af
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment