diff options
author | comex | 2015-02-01 01:56:29 -0500 |
---|---|---|
committer | comex | 2015-02-01 01:56:42 -0500 |
commit | a23ef990492cd0384de1a924c44805587d5b5aed (patch) | |
tree | aa3a28446fc1a7ca1d799c8f3ad3acc6afdea0f2 /lib/arm/jump-patch.h | |
parent | trivial wording tweak (diff) | |
download | substitute-a23ef990492cd0384de1a924c44805587d5b5aed.tar.gz |
fix my utter failure to handle branches/conditionals correctly (on ARM)
Diffstat (limited to 'lib/arm/jump-patch.h')
-rw-r--r-- | lib/arm/jump-patch.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/arm/jump-patch.h b/lib/arm/jump-patch.h index 238d56e..b65a97d 100644 --- a/lib/arm/jump-patch.h +++ b/lib/arm/jump-patch.h @@ -1,7 +1,7 @@ #pragma once #include "dis.h" +#include "arm/assemble.h" #define MAX_JUMP_PATCH_SIZE 8 -#define MAX_REWRITTEN_SIZE (12 * 4) /* actually should be less */ static inline int jump_patch_size(UNUSED uintptr_t pc, UNUSED uintptr_t dpc, @@ -13,9 +13,6 @@ static inline int jump_patch_size(UNUSED uintptr_t pc, static inline void make_jump_patch(void **codep, UNUSED uintptr_t pc, uintptr_t dpc, struct arch_dis_ctx arch) { - if (arch.pc_low_bit) - op32(codep, 0xf000f8df); - else - op32(codep, 0xe51ff004); - op32(codep, (uint32_t) dpc); + struct assemble_ctx actx = {codep, arch.pc_low_bit, 0xe}; + LDR_PC(actx, dpc); } |