comparison lwasm/lwasm.c @ 375:3498b2d88376

Added export list to object output
author lost@starbug
date Mon, 26 Apr 2010 17:14:04 -0600
parents d99322ef6f21
children 91c0fe026940
comparison
equal deleted inserted replaced
374:d99322ef6f21 375:3498b2d88376
33 33
34 #include "lwasm.h" 34 #include "lwasm.h"
35 35
36 void lwasm_register_error(asmstate_t *as, line_t *l, const char *msg, ...); 36 void lwasm_register_error(asmstate_t *as, line_t *l, const char *msg, ...);
37 37
38 int lwasm_expr_exportable(asmstate_t *as, lw_expr_t expr)
39 {
40 return 0;
41 }
42
43 int lwasm_expr_exportval(asmstate_t *as, lw_expr_t expr)
44 {
45 return 0;
46 }
47
38 lw_expr_t lwasm_evaluate_var(char *var, void *priv) 48 lw_expr_t lwasm_evaluate_var(char *var, void *priv)
39 { 49 {
40 asmstate_t *as = (asmstate_t *)priv; 50 asmstate_t *as = (asmstate_t *)priv;
41 lw_expr_t e; 51 lw_expr_t e;
42 importlist_t *im; 52 importlist_t *im;
85 95
86 lw_expr_t lwasm_evaluate_special(int t, void *ptr, void *priv) 96 lw_expr_t lwasm_evaluate_special(int t, void *ptr, void *priv)
87 { 97 {
88 switch (t) 98 switch (t)
89 { 99 {
100 case lwasm_expr_secbase:
101 {
102 line_t *cl = ptr;
103 if (cl -> as -> exportcheck && ptr == cl -> as -> csect)
104 return lw_expr_build(lw_expr_type_int, 0);
105 return NULL;
106 }
107
90 case lwasm_expr_linelen: 108 case lwasm_expr_linelen:
91 { 109 {
92 line_t *cl = ptr; 110 line_t *cl = ptr;
93 if (cl -> len == -1) 111 if (cl -> len == -1)
94 return NULL; 112 return NULL;