|
|
|
@ -267,9 +267,11 @@ int lookup_function(ast *node, struct fn_desc *fn)
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int lookup_constant(ast *node, int *constant) |
|
|
|
|
#define lookup_constant(node, constant) \ |
|
|
|
|
lookup_constant_string(node->info.string, constant) |
|
|
|
|
|
|
|
|
|
int lookup_constant_string(char *constantname, int *constant) |
|
|
|
|
{ |
|
|
|
|
char *constantname = node->info.string; |
|
|
|
|
struct hashentry *hashptr; |
|
|
|
|
|
|
|
|
|
if (constant_count < 0) |
|
|
|
@ -1185,6 +1187,7 @@ void output_code(void)
|
|
|
|
|
int morepasses = 1; |
|
|
|
|
int passno = 0; |
|
|
|
|
int pc; |
|
|
|
|
int abiver; |
|
|
|
|
|
|
|
|
|
while (morepasses) { |
|
|
|
|
ptr = instr_head; |
|
|
|
@ -1259,9 +1262,22 @@ void output_code(void)
|
|
|
|
|
output_byte(VERSION1); |
|
|
|
|
output_byte(VERSION2); |
|
|
|
|
|
|
|
|
|
#define ABIVERSION(x) do { \ |
|
|
|
|
abiver = 0; \
|
|
|
|
|
if (!lookup_constant_string(x, &abiver)) \
|
|
|
|
|
printf("%s not defined\n", x); \
|
|
|
|
|
output_int(abiver); \
|
|
|
|
|
} while (0) |
|
|
|
|
|
|
|
|
|
pc = (pc + 3) & ~3; /* Align table */ |
|
|
|
|
|
|
|
|
|
output_int(pc+8); /* Pointer to function table */ |
|
|
|
|
output_int(pc+28); /* Pointer to function table */ |
|
|
|
|
|
|
|
|
|
ABIVERSION("__abiversion1"); |
|
|
|
|
ABIVERSION("__abiversion2"); |
|
|
|
|
ABIVERSION("__abiversion3"); |
|
|
|
|
ABIVERSION("__abiversion4"); |
|
|
|
|
ABIVERSION("__abiversion5"); |
|
|
|
|
|
|
|
|
|
ptr = instr_head; |
|
|
|
|
pc = 0; |
|
|
|
|