Force TARGET_TB_PCREL to 1
This commit is contained in:
parent
97211a7b7c
commit
c3a14af2d3
@ -1054,9 +1054,10 @@ int cpu_exec(CPUState *cpu)
|
|||||||
|
|
||||||
//// --- Begin LibAFL code ---
|
//// --- Begin LibAFL code ---
|
||||||
|
|
||||||
|
#if !TARGET_TB_PCREL
|
||||||
if (last_tb->jmp_reset_offset[1] != TB_JMP_RESET_OFFSET_INVALID) {
|
if (last_tb->jmp_reset_offset[1] != TB_JMP_RESET_OFFSET_INVALID) {
|
||||||
mmap_lock();
|
mmap_lock();
|
||||||
TranslationBlock *edge = libafl_gen_edge(cpu, last_tb->pc, tb->pc,
|
TranslationBlock *edge = libafl_gen_edge(cpu, tb_pc(last_tb), tb_pc(tb),
|
||||||
tb_exit, cs_base, flags, cflags);
|
tb_exit, cs_base, flags, cflags);
|
||||||
mmap_unlock();
|
mmap_unlock();
|
||||||
|
|
||||||
@ -1069,6 +1070,10 @@ int cpu_exec(CPUState *cpu)
|
|||||||
} else {
|
} else {
|
||||||
tb_add_jump(last_tb, tb_exit, tb);
|
tb_add_jump(last_tb, tb_exit, tb);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
// No party if TARGET_TB_PCREL is 1
|
||||||
|
tb_add_jump(last_tb, tb_exit, tb);
|
||||||
|
#endif
|
||||||
|
|
||||||
//// --- End LibAFL code ---
|
//// --- End LibAFL code ---
|
||||||
}
|
}
|
||||||
|
@ -2062,7 +2062,9 @@ TranslationBlock *libafl_gen_edge(CPUState *cpu, target_ulong src_block,
|
|||||||
|
|
||||||
gen_code_buf = tcg_ctx->code_gen_ptr;
|
gen_code_buf = tcg_ctx->code_gen_ptr;
|
||||||
tb->tc.ptr = tcg_splitwx_to_rx(gen_code_buf);
|
tb->tc.ptr = tcg_splitwx_to_rx(gen_code_buf);
|
||||||
|
#if !TARGET_TB_PCREL
|
||||||
tb->pc = pc;
|
tb->pc = pc;
|
||||||
|
#endif
|
||||||
tb->cs_base = cs_base;
|
tb->cs_base = cs_base;
|
||||||
tb->flags = flags;
|
tb->flags = flags;
|
||||||
tb->cflags = cflags;
|
tb->cflags = cflags;
|
||||||
@ -2102,7 +2104,7 @@ TranslationBlock *libafl_gen_edge(CPUState *cpu, target_ulong src_block,
|
|||||||
tcg_ctx->cpu = NULL;
|
tcg_ctx->cpu = NULL;
|
||||||
max_insns = tb->icount;
|
max_insns = tb->icount;
|
||||||
|
|
||||||
trace_translate_block(tb, tb->pc, tb->tc.ptr);
|
trace_translate_block(tb, pc, tb->tc.ptr);
|
||||||
|
|
||||||
/* generate machine code */
|
/* generate machine code */
|
||||||
tb->jmp_reset_offset[0] = TB_JMP_RESET_OFFSET_INVALID;
|
tb->jmp_reset_offset[0] = TB_JMP_RESET_OFFSET_INVALID;
|
||||||
|
@ -33,6 +33,8 @@
|
|||||||
|
|
||||||
#include "cpu-param.h"
|
#include "cpu-param.h"
|
||||||
|
|
||||||
|
#define TARGET_TB_PCREL 1
|
||||||
|
|
||||||
#ifndef TARGET_LONG_BITS
|
#ifndef TARGET_LONG_BITS
|
||||||
# error TARGET_LONG_BITS must be defined in cpu-param.h
|
# error TARGET_LONG_BITS must be defined in cpu-param.h
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user