Add XBox 360 port.

Thanks to Eddie Edwards.
This commit is contained in:
Mike Pall
2013-01-21 16:43:49 +01:00
parent 2c293a96de
commit 89e4650bae
9 changed files with 233 additions and 25 deletions

View File

@@ -100,6 +100,8 @@ static const char *sym_decorate(BuildCtx *ctx,
char *p;
#if LJ_64
const char *symprefix = ctx->mode == BUILD_machasm ? "_" : "";
#elif LJ_TARGET_XBOX360
const char *symprefix = "";
#else
const char *symprefix = ctx->mode != BUILD_elfasm ? "_" : "";
#endif
@@ -136,7 +138,11 @@ static int collect_reloc(BuildCtx *ctx, uint8_t *addr, int idx, int type)
ctx->reloc[ctx->nreloc].sym = relocmap[idx];
ctx->reloc[ctx->nreloc].type = type;
ctx->nreloc++;
#if LJ_TARGET_XBOX360
return (int)(ctx->code - addr) + 4; /* Encode symbol offset of .text. */
#else
return 0; /* Encode symbol offset of 0. */
#endif
}
/* Naive insertion sort. Performance doesn't matter here. */