PPC: Add frame unwind info for assembler part.
Add define for target-specific exception handler return register.
This commit is contained in:
@@ -2773,7 +2773,89 @@ static int build_backend(BuildCtx *ctx)
|
||||
/* Emit pseudo frame-info for all assembler functions. */
|
||||
static void emit_asm_debug(BuildCtx *ctx)
|
||||
{
|
||||
/* NYI */
|
||||
UNUSED(ctx);
|
||||
int i;
|
||||
switch (ctx->mode) {
|
||||
case BUILD_elfasm:
|
||||
fprintf(ctx->fp, "\t.section .debug_frame,\"\",@progbits\n");
|
||||
fprintf(ctx->fp,
|
||||
".Lframe0:\n"
|
||||
"\t.long .LECIE0-.LSCIE0\n"
|
||||
".LSCIE0:\n"
|
||||
"\t.long 0xffffffff\n"
|
||||
"\t.byte 0x1\n"
|
||||
"\t.string \"\"\n"
|
||||
"\t.uleb128 0x1\n"
|
||||
"\t.sleb128 -4\n"
|
||||
"\t.byte 65\n"
|
||||
"\t.byte 0xc\n\t.uleb128 1\n\t.uleb128 0\n"
|
||||
"\t.align 2\n"
|
||||
".LECIE0:\n\n");
|
||||
fprintf(ctx->fp,
|
||||
".LSFDE0:\n"
|
||||
"\t.long .LEFDE0-.LASFDE0\n"
|
||||
".LASFDE0:\n"
|
||||
"\t.long .Lframe0\n"
|
||||
"\t.long .Lbegin\n"
|
||||
"\t.long %d\n"
|
||||
"\t.byte 0xe\n\t.uleb128 %d\n"
|
||||
"\t.byte 0x11\n\t.uleb128 65\n\t.sleb128 -1\n",
|
||||
(int)ctx->codesz, CFRAME_SIZE);
|
||||
for (i = 14; i <= 31; i++)
|
||||
#if LJ_TARGET_PPCSPE
|
||||
fprintf(ctx->fp,
|
||||
"\t.byte %d\n\t.uleb128 %d\n"
|
||||
"\t.byte 5\n\t.uleb128 %d\n\t.uleb128 %d\n",
|
||||
0x80+i, 1+2*(31-i), 1200+i, 2+2*(31-i));
|
||||
#else
|
||||
#error "missing frame info for saved registers"
|
||||
#endif
|
||||
fprintf(ctx->fp,
|
||||
"\t.align 2\n"
|
||||
".LEFDE0:\n\n");
|
||||
fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@progbits\n");
|
||||
fprintf(ctx->fp,
|
||||
".Lframe1:\n"
|
||||
"\t.long .LECIE1-.LSCIE1\n"
|
||||
".LSCIE1:\n"
|
||||
"\t.long 0\n"
|
||||
"\t.byte 0x1\n"
|
||||
"\t.string \"zPR\"\n"
|
||||
"\t.uleb128 0x1\n"
|
||||
"\t.sleb128 -4\n"
|
||||
"\t.byte 65\n"
|
||||
"\t.uleb128 6\n" /* augmentation length */
|
||||
"\t.byte 0x1b\n" /* pcrel|sdata4 */
|
||||
"\t.long lj_err_unwind_dwarf-.\n"
|
||||
"\t.byte 0x1b\n" /* pcrel|sdata4 */
|
||||
"\t.byte 0xc\n\t.uleb128 1\n\t.uleb128 0\n"
|
||||
"\t.align 2\n"
|
||||
".LECIE1:\n\n");
|
||||
fprintf(ctx->fp,
|
||||
".LSFDE1:\n"
|
||||
"\t.long .LEFDE1-.LASFDE1\n"
|
||||
".LASFDE1:\n"
|
||||
"\t.long .LASFDE1-.Lframe1\n"
|
||||
"\t.long .Lbegin-.\n"
|
||||
"\t.long %d\n"
|
||||
"\t.uleb128 0\n" /* augmentation length */
|
||||
"\t.byte 0xe\n\t.uleb128 %d\n"
|
||||
"\t.byte 0x11\n\t.uleb128 65\n\t.sleb128 -1\n",
|
||||
(int)ctx->codesz, CFRAME_SIZE);
|
||||
for (i = 14; i <= 31; i++)
|
||||
#if LJ_TARGET_PPCSPE
|
||||
fprintf(ctx->fp,
|
||||
"\t.byte %d\n\t.uleb128 %d\n"
|
||||
"\t.byte 5\n\t.uleb128 %d\n\t.uleb128 %d\n",
|
||||
0x80+i, 1+2*(31-i), 1200+i, 2+2*(31-i));
|
||||
#else
|
||||
#error "missing frame info for saved registers"
|
||||
#endif
|
||||
fprintf(ctx->fp,
|
||||
"\t.align 2\n"
|
||||
".LEFDE1:\n\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user