diff options
-rw-r--r-- | src/host/buildvm.c | 6 | ||||
-rw-r--r-- | src/vm_ppc.dasc | 4 | ||||
-rw-r--r-- | src/vm_ppcspe.dasc | 14 |
3 files changed, 15 insertions, 9 deletions
diff --git a/src/host/buildvm.c b/src/host/buildvm.c index ba8fbcba..2ce3b638 100644 --- a/src/host/buildvm.c +++ b/src/host/buildvm.c | |||
@@ -108,10 +108,16 @@ static const char *sym_decorate(BuildCtx *ctx, | |||
108 | sprintf(name, "%s%s%s", symprefix, prefix, suffix); | 108 | sprintf(name, "%s%s%s", symprefix, prefix, suffix); |
109 | p = strchr(name, '@'); | 109 | p = strchr(name, '@'); |
110 | if (p) { | 110 | if (p) { |
111 | #if LJ_TARGET_X86ORX64 | ||
111 | if (!LJ_64 && (ctx->mode == BUILD_coffasm || ctx->mode == BUILD_peobj)) | 112 | if (!LJ_64 && (ctx->mode == BUILD_coffasm || ctx->mode == BUILD_peobj)) |
112 | name[0] = '@'; | 113 | name[0] = '@'; |
113 | else | 114 | else |
114 | *p = '\0'; | 115 | *p = '\0'; |
116 | #elif (LJ_TARGET_PPC || LJ_TARGET_PPCSPE) && !LJ_TARGET_CONSOLE | ||
117 | /* Keep @plt. */ | ||
118 | #else | ||
119 | *p = '\0'; | ||
120 | #endif | ||
115 | } | 121 | } |
116 | p = (char *)malloc(strlen(name)+1); /* MSVC doesn't like strdup. */ | 122 | p = (char *)malloc(strlen(name)+1); /* MSVC doesn't like strdup. */ |
117 | strcpy(p, name); | 123 | strcpy(p, name); |
diff --git a/src/vm_ppc.dasc b/src/vm_ppc.dasc index 685ea518..f2530811 100644 --- a/src/vm_ppc.dasc +++ b/src/vm_ppc.dasc | |||
@@ -49,7 +49,7 @@ | |||
49 | |// Convenience macros for TOC handling. | 49 | |// Convenience macros for TOC handling. |
50 | |.if TOC | 50 | |.if TOC |
51 | |// Linker needs a TOC patch area for every external call relocation. | 51 | |// Linker needs a TOC patch area for every external call relocation. |
52 | |.macro blex, target; bl extern target; nop; .endmacro | 52 | |.macro blex, target; bl extern target@plt; nop; .endmacro |
53 | |.macro .toc, a, b; a, b; .endmacro | 53 | |.macro .toc, a, b; a, b; .endmacro |
54 | |.if P64 | 54 | |.if P64 |
55 | |.define TOC_OFS, 8 | 55 | |.define TOC_OFS, 8 |
@@ -59,7 +59,7 @@ | |||
59 | |.define ENV_OFS, 8 | 59 | |.define ENV_OFS, 8 |
60 | |.endif | 60 | |.endif |
61 | |.else // No TOC. | 61 | |.else // No TOC. |
62 | |.macro blex, target; bl extern target; .endmacro | 62 | |.macro blex, target; bl extern target@plt; .endmacro |
63 | |.macro .toc, a, b; .endmacro | 63 | |.macro .toc, a, b; .endmacro |
64 | |.endif | 64 | |.endif |
65 | |.macro .tocenv, a, b; .if TOCENV; a, b; .endif; .endmacro | 65 | |.macro .tocenv, a, b; .if TOCENV; a, b; .endif; .endmacro |
diff --git a/src/vm_ppcspe.dasc b/src/vm_ppcspe.dasc index 4fabc02f..293e3919 100644 --- a/src/vm_ppcspe.dasc +++ b/src/vm_ppcspe.dasc | |||
@@ -1390,7 +1390,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
1390 | | checknum CARG2 | 1390 | | checknum CARG2 |
1391 | | evmergehi CARG1, CARG2, CARG2 | 1391 | | evmergehi CARG1, CARG2, CARG2 |
1392 | | checkfail ->fff_fallback | 1392 | | checkfail ->fff_fallback |
1393 | | bl extern func | 1393 | | bl extern func@plt |
1394 | | evmergelo CRET1, CRET1, CRET2 | 1394 | | evmergelo CRET1, CRET1, CRET2 |
1395 | | b ->fff_restv | 1395 | | b ->fff_restv |
1396 | |.endmacro | 1396 | |.endmacro |
@@ -1405,7 +1405,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
1405 | | checknum CARG1 | 1405 | | checknum CARG1 |
1406 | | evmergehi CARG3, CARG4, CARG4 | 1406 | | evmergehi CARG3, CARG4, CARG4 |
1407 | | checkanyfail ->fff_fallback | 1407 | | checkanyfail ->fff_fallback |
1408 | | bl extern func | 1408 | | bl extern func@plt |
1409 | | evmergelo CRET1, CRET1, CRET2 | 1409 | | evmergelo CRET1, CRET1, CRET2 |
1410 | | b ->fff_restv | 1410 | | b ->fff_restv |
1411 | |.endmacro | 1411 | |.endmacro |
@@ -1437,7 +1437,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
1437 | | checknum CARG2 | 1437 | | checknum CARG2 |
1438 | | evmergehi CARG1, CARG2, CARG2 | 1438 | | evmergehi CARG1, CARG2, CARG2 |
1439 | | checkfail ->fff_fallback | 1439 | | checkfail ->fff_fallback |
1440 | | bl extern log | 1440 | | bl extern log@plt |
1441 | | evmergelo CRET1, CRET1, CRET2 | 1441 | | evmergelo CRET1, CRET1, CRET2 |
1442 | | b ->fff_restv | 1442 | | b ->fff_restv |
1443 | | | 1443 | | |
@@ -1471,7 +1471,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
1471 | | checknum CARG1 | 1471 | | checknum CARG1 |
1472 | | checkanyfail ->fff_fallback | 1472 | | checkanyfail ->fff_fallback |
1473 | | efdctsi CARG3, CARG4 | 1473 | | efdctsi CARG3, CARG4 |
1474 | | bl extern ldexp | 1474 | | bl extern ldexp@plt |
1475 | | evmergelo CRET1, CRET1, CRET2 | 1475 | | evmergelo CRET1, CRET1, CRET2 |
1476 | | b ->fff_restv | 1476 | | b ->fff_restv |
1477 | | | 1477 | | |
@@ -1484,7 +1484,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
1484 | | checkfail ->fff_fallback | 1484 | | checkfail ->fff_fallback |
1485 | | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) | 1485 | | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) |
1486 | | lwz PC, FRAME_PC(BASE) | 1486 | | lwz PC, FRAME_PC(BASE) |
1487 | | bl extern frexp | 1487 | | bl extern frexp@plt |
1488 | | lwz TMP1, DISPATCH_GL(tmptv)(DISPATCH) | 1488 | | lwz TMP1, DISPATCH_GL(tmptv)(DISPATCH) |
1489 | | evmergelo CRET1, CRET1, CRET2 | 1489 | | evmergelo CRET1, CRET1, CRET2 |
1490 | | efdcfsi CRET2, TMP1 | 1490 | | efdcfsi CRET2, TMP1 |
@@ -1503,7 +1503,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
1503 | | checkfail ->fff_fallback | 1503 | | checkfail ->fff_fallback |
1504 | | la CARG3, -8(BASE) | 1504 | | la CARG3, -8(BASE) |
1505 | | lwz PC, FRAME_PC(BASE) | 1505 | | lwz PC, FRAME_PC(BASE) |
1506 | | bl extern modf | 1506 | | bl extern modf@plt |
1507 | | evmergelo CRET1, CRET1, CRET2 | 1507 | | evmergelo CRET1, CRET1, CRET2 |
1508 | | la RA, -8(BASE) | 1508 | | la RA, -8(BASE) |
1509 | | evstdd CRET1, 0(BASE) | 1509 | | evstdd CRET1, 0(BASE) |
@@ -2399,7 +2399,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
2399 | | checknum CARG1 | 2399 | | checknum CARG1 |
2400 | | evmergehi CARG3, CARG4, CARG4 | 2400 | | evmergehi CARG3, CARG4, CARG4 |
2401 | | checkanyfail ->vmeta_arith_vv | 2401 | | checkanyfail ->vmeta_arith_vv |
2402 | | bl extern pow | 2402 | | bl extern pow@plt |
2403 | | evmergelo CRET2, CRET1, CRET2 | 2403 | | evmergelo CRET2, CRET1, CRET2 |
2404 | | evstddx CRET2, BASE, RA | 2404 | | evstddx CRET2, BASE, RA |
2405 | | ins_next | 2405 | | ins_next |