comparison lwasm/pseudo.c @ 202:1a75121c3c3f

Yet again try to get importing undefined exports working
author lost
date Sun, 22 Mar 2009 21:20:45 +0000
parents 7824f94c5786
children bae1e3ecdce1
comparison
equal deleted inserted replaced
201:7824f94c5786 202:1a75121c3c3f
1080 1080
1081 1081
1082 // the symbol better be defined at this point (pass 2) 1082 // the symbol better be defined at this point (pass 2)
1083 // local symbols cannot be exported nor can "global" symbols 1083 // local symbols cannot be exported nor can "global" symbols
1084 se = lwasm_find_symbol(as, l -> sym, -1); 1084 se = lwasm_find_symbol(as, l -> sym, -1);
1085 if (!se && (as -> pragmas & PRAGMA_IMPORTUNDEFEXPORT)) 1085 if ((!se || (se -> flags & SYMBOL_EXTERN)) && (as -> pragmas & PRAGMA_IMPORTUNDEFEXPORT))
1086 { 1086 {
1087 void *p; 1087 void *p;
1088 p = as -> csect; 1088 p = as -> csect;
1089 as -> csect = NULL; 1089 as -> csect = NULL;
1090 lwasm_register_symbol(as, l, l -> sym, 0, SYMBOL_EXTERN); 1090 lwasm_register_symbol(as, l, l -> sym, 0, SYMBOL_EXTERN);
1134 ex -> next = se -> sect -> exports; 1134 ex -> next = se -> sect -> exports;
1135 se -> sect -> exports = ex; 1135 se -> sect -> exports = ex;
1136 ex -> offset = se -> value; 1136 ex -> offset = se -> value;
1137 ex -> sym = lwasm_strdup(se -> sym); 1137 ex -> sym = lwasm_strdup(se -> sym);
1138 } 1138 }
1139 next:
1139 if (after == 1) 1140 if (after == 1)
1140 { 1141 {
1141 if (**p == ',') 1142 if (**p == ',')
1142 { 1143 {
1143 debug_message(2, "Export another symbol: %s", *p); 1144 debug_message(2, "Export another symbol: %s", *p);