|
|
@@ -261,33 +261,14 @@ mono_arch_nullify_class_init_trampoline (guint8 *code, mgreg_t *regs)
|
|
|
*/
|
|
|
|
|
|
mono_arch_patch_callsite (code - 2, code - 2 + 5, nullified_class_init_trampoline);
|
|
|
- } else if ((buf [4] == 0x41) && (buf [5] == 0xff)) {
|
|
|
- /* call <REG> */
|
|
|
- /* happens on machines without MAP_32BIT like freebsd */
|
|
|
- /* amd64_set_reg_template is 10 bytes long */
|
|
|
- guint8* buf = code - 10;
|
|
|
-
|
|
|
- /* FIXME: Make this thread safe */
|
|
|
- /* Padding code suggested by the AMD64 Opt Manual */
|
|
|
- buf [0] = 0x66;
|
|
|
- buf [1] = 0x66;
|
|
|
- buf [2] = 0x66;
|
|
|
- buf [3] = 0x90;
|
|
|
- buf [4] = 0x66;
|
|
|
- buf [5] = 0x66;
|
|
|
- buf [6] = 0x66;
|
|
|
- buf [7] = 0x90;
|
|
|
- buf [8] = 0x66;
|
|
|
- buf [9] = 0x66;
|
|
|
- buf [10] = 0x90;
|
|
|
- buf [11] = 0x66;
|
|
|
- buf [12] = 0x90;
|
|
|
} else if ((buf [5] == 0xff) && x86_modrm_mod (buf [6]) == 3 && x86_modrm_reg (buf [6]) == 2) {
|
|
|
/* call *<reg> */
|
|
|
- /* Generated by the LLVM JIT */
|
|
|
+ /* Generated by the LLVM JIT or on platforms without MAP_32BIT set */
|
|
|
+ guint8* buf = code;
|
|
|
+
|
|
|
/* FIXME: Not thread safe */
|
|
|
- buf [0] = 0x90;
|
|
|
buf [1] = 0x90;
|
|
|
+ buf [2] = 0x90;
|
|
|
} else if (buf [4] == 0x90 || buf [5] == 0xeb || buf [6] == 0x66) {
|
|
|
/* Already changed by another thread */
|
|
|
;
|