From 5594a0c653fcf3b36d397448c64c64473e76e8fe Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Fri, 5 Mar 2010 03:21:52 +0100 Subject: [PATCH] Fix generated 64 bit Mach-O assembler output. --- src/buildvm_x64.h | 8 ++++++++ src/buildvm_x64win.h | 8 ++++++++ src/buildvm_x86.dasc | 8 ++++++++ src/buildvm_x86.h | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/src/buildvm_x64.h b/src/buildvm_x64.h index 57508e89..f19189f9 100644 --- a/src/buildvm_x64.h +++ b/src/buildvm_x64.h @@ -2390,7 +2390,11 @@ static void emit_asm_debug(BuildCtx *ctx) "\t.byte " REG_RA "\n" "\t.byte 6\n" /* augmentation length */ "\t.byte 0x9b\n" /* indirect|pcrel|sdata4 */ +#if LJ_64 + "\t.long _lj_err_unwind_dwarf+4@GOTPCREL\n" +#else "\t.long L_lj_err_unwind_dwarf$non_lazy_ptr-.\n" +#endif "\t.byte 0x1b\n" /* pcrel|sdata4 */ #if LJ_64 "\t.byte 0xc\n\t.byte " REG_SP "\n\t.byte " SZPTR "\n" @@ -2424,11 +2428,15 @@ static void emit_asm_debug(BuildCtx *ctx) #endif "\t.align " BSZPTR "\n" "LEFDE1:\n\n", (int)ctx->codesz, CFRAME_SIZE); +#if LJ_64 + fprintf(ctx->fp, "\t.subsections_via_symbols\n"); +#else fprintf(ctx->fp, "\t.non_lazy_symbol_pointer\n" "L_lj_err_unwind_dwarf$non_lazy_ptr:\n" ".indirect_symbol _lj_err_unwind_dwarf\n" ".long 0\n"); +#endif break; default: /* Difficult for other modes. */ break; diff --git a/src/buildvm_x64win.h b/src/buildvm_x64win.h index 97ab59d9..eb0a7eab 100644 --- a/src/buildvm_x64win.h +++ b/src/buildvm_x64win.h @@ -2390,7 +2390,11 @@ static void emit_asm_debug(BuildCtx *ctx) "\t.byte " REG_RA "\n" "\t.byte 6\n" /* augmentation length */ "\t.byte 0x9b\n" /* indirect|pcrel|sdata4 */ +#if LJ_64 + "\t.long _lj_err_unwind_dwarf+4@GOTPCREL\n" +#else "\t.long L_lj_err_unwind_dwarf$non_lazy_ptr-.\n" +#endif "\t.byte 0x1b\n" /* pcrel|sdata4 */ #if LJ_64 "\t.byte 0xc\n\t.byte " REG_SP "\n\t.byte " SZPTR "\n" @@ -2424,11 +2428,15 @@ static void emit_asm_debug(BuildCtx *ctx) #endif "\t.align " BSZPTR "\n" "LEFDE1:\n\n", (int)ctx->codesz, CFRAME_SIZE); +#if LJ_64 + fprintf(ctx->fp, "\t.subsections_via_symbols\n"); +#else fprintf(ctx->fp, "\t.non_lazy_symbol_pointer\n" "L_lj_err_unwind_dwarf$non_lazy_ptr:\n" ".indirect_symbol _lj_err_unwind_dwarf\n" ".long 0\n"); +#endif break; default: /* Difficult for other modes. */ break; diff --git a/src/buildvm_x86.dasc b/src/buildvm_x86.dasc index fbeb4f29..3ad0d812 100644 --- a/src/buildvm_x86.dasc +++ b/src/buildvm_x86.dasc @@ -5108,7 +5108,11 @@ static void emit_asm_debug(BuildCtx *ctx) "\t.byte " REG_RA "\n" "\t.byte 6\n" /* augmentation length */ "\t.byte 0x9b\n" /* indirect|pcrel|sdata4 */ +#if LJ_64 + "\t.long _lj_err_unwind_dwarf+4@GOTPCREL\n" +#else "\t.long L_lj_err_unwind_dwarf$non_lazy_ptr-.\n" +#endif "\t.byte 0x1b\n" /* pcrel|sdata4 */ #if LJ_64 "\t.byte 0xc\n\t.byte " REG_SP "\n\t.byte " SZPTR "\n" @@ -5142,11 +5146,15 @@ static void emit_asm_debug(BuildCtx *ctx) #endif "\t.align " BSZPTR "\n" "LEFDE1:\n\n", (int)ctx->codesz, CFRAME_SIZE); +#if LJ_64 + fprintf(ctx->fp, "\t.subsections_via_symbols\n"); +#else fprintf(ctx->fp, "\t.non_lazy_symbol_pointer\n" "L_lj_err_unwind_dwarf$non_lazy_ptr:\n" ".indirect_symbol _lj_err_unwind_dwarf\n" ".long 0\n"); +#endif break; default: /* Difficult for other modes. */ break; diff --git a/src/buildvm_x86.h b/src/buildvm_x86.h index 8a421ec8..35e3893e 100644 --- a/src/buildvm_x86.h +++ b/src/buildvm_x86.h @@ -2518,7 +2518,11 @@ static void emit_asm_debug(BuildCtx *ctx) "\t.byte " REG_RA "\n" "\t.byte 6\n" /* augmentation length */ "\t.byte 0x9b\n" /* indirect|pcrel|sdata4 */ +#if LJ_64 + "\t.long _lj_err_unwind_dwarf+4@GOTPCREL\n" +#else "\t.long L_lj_err_unwind_dwarf$non_lazy_ptr-.\n" +#endif "\t.byte 0x1b\n" /* pcrel|sdata4 */ #if LJ_64 "\t.byte 0xc\n\t.byte " REG_SP "\n\t.byte " SZPTR "\n" @@ -2552,11 +2556,15 @@ static void emit_asm_debug(BuildCtx *ctx) #endif "\t.align " BSZPTR "\n" "LEFDE1:\n\n", (int)ctx->codesz, CFRAME_SIZE); +#if LJ_64 + fprintf(ctx->fp, "\t.subsections_via_symbols\n"); +#else fprintf(ctx->fp, "\t.non_lazy_symbol_pointer\n" "L_lj_err_unwind_dwarf$non_lazy_ptr:\n" ".indirect_symbol _lj_err_unwind_dwarf\n" ".long 0\n"); +#endif break; default: /* Difficult for other modes. */ break;