diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-07-30 14:15:15 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-07-30 14:19:16 -0700 |
commit | 49f6c7e7c295c0ec0bbd99683de7330f1cffd8dd (patch) | |
tree | ea6a5967b85e9084281a1b420890a1364884a35e | |
parent | acf2390683de5b0616cb705ec6467d1ddf29d24d (diff) |
add asm sending for missing symbols
-rw-r--r-- | emlink.py | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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 = {} |