Skip to content

Commit a858292

Browse files
author
Your Name
committed
Add QASAN support for PPC
1 parent 0569eff commit a858292

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

qemuafl/qasan-qemu.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct shadow_stack_block {
4646

4747
int index;
4848
target_ulong buf[SHADOW_BK_SIZE];
49-
49+
5050
struct shadow_stack_block* next;
5151

5252
};
@@ -87,6 +87,17 @@ extern __thread struct shadow_stack qasan_shadow_stack;
8787
#define BP_GET(env) ((env)->active_tc.gpr[29])
8888
#define SP_GET(env) ((env)->active_tc.gpr[30])
8989

90+
#elif defined(TARGET_PPC)
91+
92+
#define PC_GET(env) ((env)->nip)
93+
/*
94+
* PPC doesn't really have a frame pointer since stack frames are built into a
95+
* linked list. The BP is used only for display purposes in any case, so we will
96+
* just use the SP here.
97+
*/
98+
#define BP_GET(env) ((env)->gpr[1])
99+
#define SP_GET(env) ((env)->gpr[1])
100+
90101
#else
91102
//#error "Target not supported by asan-giovese"
92103
#define DO_NOT_USE_QASAN 1

0 commit comments

Comments
 (0)