[project @ 2004-11-22 09:18:03 by desrt]
authordesrt <unknown>
Mon, 22 Nov 2004 09:18:03 +0000 (09:18 +0000)
committerdesrt <unknown>
Mon, 22 Nov 2004 09:18:03 +0000 (09:18 +0000)
#ifdef powerpc64:
fixed errors in run/return code revealed by testing

ghc/rts/StgCRun.c

index 8bb6f08..b835a49 100644 (file)
@@ -654,9 +654,20 @@ static void StgRunIsImplementedInAssembler(void)
        // r13 thread local state (never modified, don't need to save)
        // r14-r31 callee-save
        __asm__ volatile (
-               "\t.globl StgRun\n"
-               "\t.type StgRun,@function\n"
+               ".section \".opd\",\"aw\"\n"
+               ".align 3\n"
+               ".globl StgRun\n"
                "StgRun:\n"
+                       "\t.quad\t.StgRun,.TOC.@tocbase,0\n"
+                       "\t.size StgRun,24\n"
+               ".globl StgReturn\n"
+               "StgReturn:\n"
+                       "\t.quad\t.StgReturn,.TOC.@tocbase,0\n"
+                       "\t.size StgReturn,24\n"
+               ".previous\n"
+               ".globl .StgRun\n"
+               ".type .StgRun,@function\n"
+               ".StgRun:\n"
                        "\tmflr 0\n"
                        "\tmr 5, 1\n"
                        "\tstd 0, 16(1)\n"
@@ -703,9 +714,9 @@ static void StgRunIsImplementedInAssembler(void)
                        "\tld 3, 0(3)\n"
                        "\tmtctr 3\n"
                        "\tbctr\n"
-               ".globl StgReturn\n"
-               "\t.type StgReturn,@function\n"
-               "StgReturn:\n"
+               ".globl .StgReturn\n"
+               ".type .StgReturn,@function\n"
+               ".StgReturn:\n"
                        "\tmr 3,14\n"
                        "\tla 5, %0(1)\n" // load address == addi r5, r1, %0
                        "\tld 2, -296(5)\n"