From 3f1f9e11f4f699ae94182d4cba158092f434a7f6 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 8 Dec 2009 20:35:29 +0100 Subject: Fast forward to sync public repo. Compile math.sinh(), math.cosh(), math.tanh() and math.random(). Compile various io.*() functions. Drive the GC forward on string allocations in the parser. Improve KNUM fuse vs. load heuristics. Add abstract C call handling to IR. --- src/buildvm_asm.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/buildvm_asm.c') diff --git a/src/buildvm_asm.c b/src/buildvm_asm.c index 5daab13b..31b6f61e 100644 --- a/src/buildvm_asm.c +++ b/src/buildvm_asm.c @@ -26,6 +26,14 @@ static void emit_asm_bytes(BuildCtx *ctx, uint8_t *p, int n) static void emit_asm_reloc(BuildCtx *ctx, BuildReloc *r) { const char *sym = ctx->extnames[r->sym]; + const char *p = strchr(sym, '@'); + char buf[80]; + if (p) { + /* Always strip fastcall suffix. Wrong for (unused) COFF on Win32. */ + strncpy(buf, sym, p-sym); + buf[p-sym] = '\0'; + sym = buf; + } switch (ctx->mode) { case BUILD_elfasm: if (r->type) -- cgit v1.2.3-55-g6feb