2
0
Эх сурвалжийг харах

Merge branch 'master' into v2.1

Mike Pall 12 жил өмнө
parent
commit
e92d64a841

+ 6 - 0
src/host/buildvm.c

@@ -108,10 +108,16 @@ static const char *sym_decorate(BuildCtx *ctx,
   sprintf(name, "%s%s%s", symprefix, prefix, suffix);
   p = strchr(name, '@');
   if (p) {
+#if LJ_TARGET_X86ORX64
     if (!LJ_64 && (ctx->mode == BUILD_coffasm || ctx->mode == BUILD_peobj))
       name[0] = '@';
     else
       *p = '\0';
+#elif (LJ_TARGET_PPC  || LJ_TARGET_PPCSPE) && !LJ_TARGET_CONSOLE
+    /* Keep @plt. */
+#else
+    *p = '\0';
+#endif
   }
   p = (char *)malloc(strlen(name)+1);  /* MSVC doesn't like strdup. */
   strcpy(p, name);

+ 2 - 2
src/vm_ppc.dasc

@@ -49,7 +49,7 @@
 |// Convenience macros for TOC handling.
 |.if TOC
 |// Linker needs a TOC patch area for every external call relocation.
-|.macro blex, target; bl extern target; nop; .endmacro
+|.macro blex, target; bl extern target@plt; nop; .endmacro
 |.macro .toc, a, b; a, b; .endmacro
 |.if P64
 |.define TOC_OFS,	 8
@@ -59,7 +59,7 @@
 |.define ENV_OFS,	8
 |.endif
 |.else  // No TOC.
-|.macro blex, target; bl extern target; .endmacro
+|.macro blex, target; bl extern target@plt; .endmacro
 |.macro .toc, a, b; .endmacro
 |.endif
 |.macro .tocenv, a, b; .if TOCENV; a, b; .endif; .endmacro

+ 7 - 7
src/vm_ppcspe.dasc

@@ -1390,7 +1390,7 @@ static void build_subroutines(BuildCtx *ctx)
   |  checknum CARG2
   |   evmergehi CARG1, CARG2, CARG2
   |  checkfail ->fff_fallback
-  |  bl extern func
+  |  bl extern func@plt
   |  evmergelo CRET1, CRET1, CRET2
   |  b ->fff_restv
   |.endmacro
@@ -1405,7 +1405,7 @@ static void build_subroutines(BuildCtx *ctx)
   |  checknum CARG1
   |   evmergehi CARG3, CARG4, CARG4
   |  checkanyfail ->fff_fallback
-  |  bl extern func
+  |  bl extern func@plt
   |  evmergelo CRET1, CRET1, CRET2
   |  b ->fff_restv
   |.endmacro
@@ -1437,7 +1437,7 @@ static void build_subroutines(BuildCtx *ctx)
   |  checknum CARG2
   |   evmergehi CARG1, CARG2, CARG2
   |  checkfail ->fff_fallback
-  |  bl extern log
+  |  bl extern log@plt
   |  evmergelo CRET1, CRET1, CRET2
   |  b ->fff_restv
   |
@@ -1465,7 +1465,7 @@ static void build_subroutines(BuildCtx *ctx)
   |  checknum CARG1
   |  checkanyfail ->fff_fallback
   |  efdctsi CARG3, CARG4
-  |  bl extern ldexp
+  |  bl extern ldexp@plt
   |  evmergelo CRET1, CRET1, CRET2
   |  b ->fff_restv
   |
@@ -1478,7 +1478,7 @@ static void build_subroutines(BuildCtx *ctx)
   |  checkfail ->fff_fallback
   |  la CARG3, DISPATCH_GL(tmptv)(DISPATCH)
   |   lwz PC, FRAME_PC(BASE)
-  |  bl extern frexp
+  |  bl extern frexp@plt
   |   lwz TMP1, DISPATCH_GL(tmptv)(DISPATCH)
   |  evmergelo CRET1, CRET1, CRET2
   |   efdcfsi CRET2, TMP1
@@ -1497,7 +1497,7 @@ static void build_subroutines(BuildCtx *ctx)
   |  checkfail ->fff_fallback
   |  la CARG3, -8(BASE)
   |   lwz PC, FRAME_PC(BASE)
-  |  bl extern modf
+  |  bl extern modf@plt
   |  evmergelo CRET1, CRET1, CRET2
   |   la RA, -8(BASE)
   |  evstdd CRET1, 0(BASE)
@@ -2393,7 +2393,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
     |  checknum CARG1
     |   evmergehi CARG3, CARG4, CARG4
     |  checkanyfail ->vmeta_arith_vv
-    |  bl extern pow
+    |  bl extern pow@plt
     |  evmergelo CRET2, CRET1, CRET2
     |  evstddx CRET2, BASE, RA
     |  ins_next