aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-30 14:15:15 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-30 14:19:16 -0700
commit49f6c7e7c295c0ec0bbd99683de7330f1cffd8dd (patch)
treeea6a5967b85e9084281a1b420890a1364884a35e
parentacf2390683de5b0616cb705ec6467d1ddf29d24d (diff)
add asm sending for missing symbols
-rw-r--r--emlink.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/emlink.py b/emlink.py
index d59cb5d3..708c08d6 100644
--- a/emlink.py
+++ b/emlink.py
@@ -124,19 +124,20 @@ class AsmModule():
del all_sendings[key] # import of external value no longer needed
main.imports_js = '\n'.join(['var %s = %s;' % (key, value) for key, value in all_imports.iteritems()]) + '\n'
- if added_sending:
- sendings_js = ', '.join(['%s: %s' % (key, value) for key, value in all_sendings.iteritems()])
- sendings_start = main.post_js.find('}, { ')+5
- sendings_end = main.post_js.find(' }, buffer);')
- main.post_js = main.post_js[:sendings_start] + sendings_js + main.post_js[sendings_end:]
-
# check for undefined references to global variables
def check_import(key, value):
if value.startswith('+') or value.endswith('|0'): # ignore functions
if key not in all_sendings:
print >> sys.stderr, 'warning: external variable %s is still not defined after linking' % key
+ all_sendings[key] = '0'
for key, value in all_imports.iteritems(): check_import(key, value)
+ if added_sending:
+ sendings_js = ', '.join(['%s: %s' % (key, value) for key, value in all_sendings.iteritems()])
+ sendings_start = main.post_js.find('}, { ')+5
+ sendings_end = main.post_js.find(' }, buffer);')
+ main.post_js = main.post_js[:sendings_start] + sendings_js + main.post_js[sendings_end:]
+
# tables
f_bases = {}
f_sizes = {}