diff options
Diffstat (limited to 'src/buildvm_ppc.dasc')
-rw-r--r-- | src/buildvm_ppc.dasc | 86 |
1 files changed, 84 insertions, 2 deletions
diff --git a/src/buildvm_ppc.dasc b/src/buildvm_ppc.dasc index 2b4e1da6..c6bf24b7 100644 --- a/src/buildvm_ppc.dasc +++ b/src/buildvm_ppc.dasc | |||
@@ -2773,7 +2773,89 @@ static int build_backend(BuildCtx *ctx) | |||
2773 | /* Emit pseudo frame-info for all assembler functions. */ | 2773 | /* Emit pseudo frame-info for all assembler functions. */ |
2774 | static void emit_asm_debug(BuildCtx *ctx) | 2774 | static void emit_asm_debug(BuildCtx *ctx) |
2775 | { | 2775 | { |
2776 | /* NYI */ | 2776 | int i; |
2777 | UNUSED(ctx); | 2777 | switch (ctx->mode) { |
2778 | case BUILD_elfasm: | ||
2779 | fprintf(ctx->fp, "\t.section .debug_frame,\"\",@progbits\n"); | ||
2780 | fprintf(ctx->fp, | ||
2781 | ".Lframe0:\n" | ||
2782 | "\t.long .LECIE0-.LSCIE0\n" | ||
2783 | ".LSCIE0:\n" | ||
2784 | "\t.long 0xffffffff\n" | ||
2785 | "\t.byte 0x1\n" | ||
2786 | "\t.string \"\"\n" | ||
2787 | "\t.uleb128 0x1\n" | ||
2788 | "\t.sleb128 -4\n" | ||
2789 | "\t.byte 65\n" | ||
2790 | "\t.byte 0xc\n\t.uleb128 1\n\t.uleb128 0\n" | ||
2791 | "\t.align 2\n" | ||
2792 | ".LECIE0:\n\n"); | ||
2793 | fprintf(ctx->fp, | ||
2794 | ".LSFDE0:\n" | ||
2795 | "\t.long .LEFDE0-.LASFDE0\n" | ||
2796 | ".LASFDE0:\n" | ||
2797 | "\t.long .Lframe0\n" | ||
2798 | "\t.long .Lbegin\n" | ||
2799 | "\t.long %d\n" | ||
2800 | "\t.byte 0xe\n\t.uleb128 %d\n" | ||
2801 | "\t.byte 0x11\n\t.uleb128 65\n\t.sleb128 -1\n", | ||
2802 | (int)ctx->codesz, CFRAME_SIZE); | ||
2803 | for (i = 14; i <= 31; i++) | ||
2804 | #if LJ_TARGET_PPCSPE | ||
2805 | fprintf(ctx->fp, | ||
2806 | "\t.byte %d\n\t.uleb128 %d\n" | ||
2807 | "\t.byte 5\n\t.uleb128 %d\n\t.uleb128 %d\n", | ||
2808 | 0x80+i, 1+2*(31-i), 1200+i, 2+2*(31-i)); | ||
2809 | #else | ||
2810 | #error "missing frame info for saved registers" | ||
2811 | #endif | ||
2812 | fprintf(ctx->fp, | ||
2813 | "\t.align 2\n" | ||
2814 | ".LEFDE0:\n\n"); | ||
2815 | fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@progbits\n"); | ||
2816 | fprintf(ctx->fp, | ||
2817 | ".Lframe1:\n" | ||
2818 | "\t.long .LECIE1-.LSCIE1\n" | ||
2819 | ".LSCIE1:\n" | ||
2820 | "\t.long 0\n" | ||
2821 | "\t.byte 0x1\n" | ||
2822 | "\t.string \"zPR\"\n" | ||
2823 | "\t.uleb128 0x1\n" | ||
2824 | "\t.sleb128 -4\n" | ||
2825 | "\t.byte 65\n" | ||
2826 | "\t.uleb128 6\n" /* augmentation length */ | ||
2827 | "\t.byte 0x1b\n" /* pcrel|sdata4 */ | ||
2828 | "\t.long lj_err_unwind_dwarf-.\n" | ||
2829 | "\t.byte 0x1b\n" /* pcrel|sdata4 */ | ||
2830 | "\t.byte 0xc\n\t.uleb128 1\n\t.uleb128 0\n" | ||
2831 | "\t.align 2\n" | ||
2832 | ".LECIE1:\n\n"); | ||
2833 | fprintf(ctx->fp, | ||
2834 | ".LSFDE1:\n" | ||
2835 | "\t.long .LEFDE1-.LASFDE1\n" | ||
2836 | ".LASFDE1:\n" | ||
2837 | "\t.long .LASFDE1-.Lframe1\n" | ||
2838 | "\t.long .Lbegin-.\n" | ||
2839 | "\t.long %d\n" | ||
2840 | "\t.uleb128 0\n" /* augmentation length */ | ||
2841 | "\t.byte 0xe\n\t.uleb128 %d\n" | ||
2842 | "\t.byte 0x11\n\t.uleb128 65\n\t.sleb128 -1\n", | ||
2843 | (int)ctx->codesz, CFRAME_SIZE); | ||
2844 | for (i = 14; i <= 31; i++) | ||
2845 | #if LJ_TARGET_PPCSPE | ||
2846 | fprintf(ctx->fp, | ||
2847 | "\t.byte %d\n\t.uleb128 %d\n" | ||
2848 | "\t.byte 5\n\t.uleb128 %d\n\t.uleb128 %d\n", | ||
2849 | 0x80+i, 1+2*(31-i), 1200+i, 2+2*(31-i)); | ||
2850 | #else | ||
2851 | #error "missing frame info for saved registers" | ||
2852 | #endif | ||
2853 | fprintf(ctx->fp, | ||
2854 | "\t.align 2\n" | ||
2855 | ".LEFDE1:\n\n"); | ||
2856 | break; | ||
2857 | default: | ||
2858 | break; | ||
2859 | } | ||
2778 | } | 2860 | } |
2779 | 2861 | ||