aboutsummaryrefslogtreecommitdiff
path: root/lib/arm/assemble.h
diff options
context:
space:
mode:
authorYifan Lu2016-11-03 23:09:51 -0700
committerYifan Lu2016-11-03 23:09:51 -0700
commitd6ccfd36f805f98648afc785c29100dbfb50614e (patch)
treee6f8d527d7a0736cae6bc197ee2aadb05102cddb /lib/arm/assemble.h
parentFixed extraction for BL/BLX thumb2 (diff)
downloadsubstitute-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.h2
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);
}