Skip to content

Instantly share code, notes, and snippets.

@rolfbjarne
Created October 29, 2011 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolfbjarne/0b4f9dfbedd8883f1702 to your computer and use it in GitHub Desktop.
Save rolfbjarne/0b4f9dfbedd8883f1702 to your computer and use it in GitHub Desktop.
diff --git a/mono/mini/aot-runtime.c b/mono/mini/aot-runtime.c
index 5f76ca7..abcc04f 100644
--- a/mono/mini/aot-runtime.c
+++ b/mono/mini/aot-runtime.c
@@ -3225,9 +3225,13 @@ mono_aot_get_plt_entry (guint8 *code)
g_assert_not_reached ();
#endif
- if ((target >= (guint8*)(amodule->plt)) && (target < (guint8*)(amodule->plt_end)))
+ if ((target >= (guint8*)(amodule->plt)) && (target < (guint8*)(amodule->plt_end))) {
+ guint8 *code2 = (guint8*) *(guint32*)target;
+ guint8 *target2 = mono_arch_get_call_target (code2);
+ if ((target2 >= (guint8*)(amodule->plt)) && (target2 < (guint8*)(amodule->plt_end)))
+ return target2;
return target;
- else
+ } else
return NULL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment