Refactor buildvm symbol generation.

Fixes Windows and OSX builds with LUAJIT_DISABLE_JIT.
This commit is contained in:
Mike Pall
2010-04-14 17:13:13 +02:00
parent fbe092c22d
commit ff82df797a
8 changed files with 203 additions and 324 deletions

View File

@@ -34,9 +34,6 @@
#define LABEL_PREFIX_LIBCF LABEL_PREFIX "lib_cf_"
#define LABEL_PREFIX_LIBINIT LABEL_PREFIX "lib_init_"
/* Extra labels. */
#define LABEL_ASM_BEGIN LABEL_PREFIX "vm_asm_begin"
/* Forward declaration. */
struct dasm_State;
@@ -66,6 +63,11 @@ typedef struct BuildReloc {
int type;
} BuildReloc;
typedef struct BuildSym {
const char *name;
int32_t ofs;
} BuildSym;
/* Build context structure. */
typedef struct BuildCtx {
/* DynASM state pointer. Should be first member. */
@@ -78,12 +80,13 @@ typedef struct BuildCtx {
/* Code and symbols generated by DynASM. */
uint8_t *code;
size_t codesz;
int npc, nglob, nsym, nreloc;
int npc, nglob, nsym, nreloc, nrelocsym;
void **glob;
int *perm;
int32_t *sym_ofs;
BuildSym *sym;
const char **relocsym;
int32_t *bc_ofs;
const char *beginsym;
/* Strings generated by DynASM. */
const char *const *extnames;
const char *const *globnames;
const char *dasm_ident;
const char *dasm_arch;