aboutsummaryrefslogtreecommitdiff
path: root/src/buildvm_asm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildvm_asm.c')
-rw-r--r--src/buildvm_asm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/buildvm_asm.c b/src/buildvm_asm.c
index 6a860c9f..01330456 100644
--- a/src/buildvm_asm.c
+++ b/src/buildvm_asm.c
@@ -202,6 +202,17 @@ void emit_asm(BuildCtx *ctx)
202 for (i = rel = 0; i < ctx->nsym; i++) { 202 for (i = rel = 0; i < ctx->nsym; i++) {
203 int32_t ofs = ctx->sym[i].ofs; 203 int32_t ofs = ctx->sym[i].ofs;
204 int32_t next = ctx->sym[i+1].ofs; 204 int32_t next = ctx->sym[i+1].ofs;
205#if LJ_TARGET_ARM && defined(__GNUC__) && !defined(LUAJIT_NO_UNWIND) && \
206 LJ_HASFFI
207 if (!strcmp(ctx->sym[i].name, "lj_vm_ffi_call"))
208 fprintf(ctx->fp,
209 ".globl lj_err_unwind_arm\n"
210 ".personality lj_err_unwind_arm\n"
211 ".fnend\n"
212 ".fnstart\n"
213 ".save {r4, r5, r11, lr}\n"
214 ".setfp r11, sp\n");
215#endif
205 emit_asm_label(ctx, ctx->sym[i].name, next - ofs, 1); 216 emit_asm_label(ctx, ctx->sym[i].name, next - ofs, 1);
206 while (rel < ctx->nreloc && ctx->reloc[rel].ofs <= next) { 217 while (rel < ctx->nreloc && ctx->reloc[rel].ofs <= next) {
207 BuildReloc *r = &ctx->reloc[rel]; 218 BuildReloc *r = &ctx->reloc[rel];
@@ -229,8 +240,10 @@ void emit_asm(BuildCtx *ctx)
229 240
230#if LJ_TARGET_ARM && defined(__GNUC__) && !defined(LUAJIT_NO_UNWIND) 241#if LJ_TARGET_ARM && defined(__GNUC__) && !defined(LUAJIT_NO_UNWIND)
231 fprintf(ctx->fp, 242 fprintf(ctx->fp,
243#if !LJ_HASFFI
232 ".globl lj_err_unwind_arm\n" 244 ".globl lj_err_unwind_arm\n"
233 ".personality lj_err_unwind_arm\n" 245 ".personality lj_err_unwind_arm\n"
246#endif
234 ".fnend\n"); 247 ".fnend\n");
235#endif 248#endif
236 249