diff options
author | Yifan Lu | 2016-11-03 23:09:51 -0700 |
---|---|---|
committer | Yifan Lu | 2016-11-03 23:09:51 -0700 |
commit | d6ccfd36f805f98648afc785c29100dbfb50614e (patch) | |
tree | e6f8d527d7a0736cae6bc197ee2aadb05102cddb /lib/arm/assemble.h | |
parent | Fixed extraction for BL/BLX thumb2 (diff) | |
download | substitute-d6ccfd36f805f98648afc785c29100dbfb50614e.tar.gz |
Made ARM patch alignment 0x4 so copy from kernel to user works
Diffstat (limited to 'lib/arm/assemble.h')
-rw-r--r-- | lib/arm/assemble.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/arm/assemble.h b/lib/arm/assemble.h index 2303a7a..625f464 100644 --- a/lib/arm/assemble.h +++ b/lib/arm/assemble.h @@ -108,4 +108,6 @@ static inline void LDR_PC(struct assemble_ctx ctx, uint32_t dpc) { else op32(ctx.codep, 0x051ff004 | ctx.cond << 28); op32(ctx.codep, (uint32_t) dpc); + if (ctx.pc & 2) // for alignment + op16(ctx.codep, 0xbf00); } |