NativeLibrary library = libname == null || libname.equals("")
? NativeLibrary.getProcess()
: NativeLibrary.getInstance(libname);
Pointer entry_point = library.getGlobalVariableAddress(symbol);
StorageSpec ss = target_spec.st.REPR.get_storage_spec(tc, target_spec.st);
if (ss.boxed_primitive == StorageSpec.BP_STR)
entry_point = entry_point.getPointer(0);
return castNativeCall(tc, target_spec, target_type, entry_point);
}