aboutsummaryrefslogtreecommitdiff
path: root/emlink.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-02 19:00:08 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-03 15:31:05 -0700
commitb9f5f841909423c08e1b516acb031cfddd5efb15 (patch)
treef7c6726a5fb757d3cfcfa015c2ec5cb79565ef04 /emlink.py
parent1ff89fa1536f8b46a5c1bf702952ac37df591a55 (diff)
fix f_bases handling in static linker
Diffstat (limited to 'emlink.py')
-rw-r--r--emlink.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/emlink.py b/emlink.py
index 16ec0230..64d6a679 100644
--- a/emlink.py
+++ b/emlink.py
@@ -175,6 +175,7 @@ class AsmModule():
for table, data in self.tables.iteritems():
main.tables[table] = self.merge_tables(table, main.tables.get(table), data, replacements, f_bases, f_sizes)
main.combine_tables()
+ #print >> sys.stderr, 'f bases', f_bases
# relocate
temp = shared.Building.js_optimizer(self.filename, ['asm', 'relocate', 'last'], extra_info={
@@ -291,16 +292,17 @@ class AsmModule():
return tables
def merge_tables(self, table, main, side, replacements, f_bases, f_sizes):
+ sig = table.split('_')[-1]
side = side[1:-1].split(',')
side = map(lambda f: replacements[f] if f in replacements else f, side)
if not main:
- f_bases[table] = 0
+ f_bases[sig] = 0
f_sizes[table] = len(side)
return '[' + ','.join(side) + ']'
main = main[1:-1].split(',')
# TODO: handle non-aliasing case too
assert len(main) % 2 == 0
- f_bases[table] = len(main)
+ f_bases[sig] = len(main)
ret = main + side
size = 2
while size < len(ret): size *= 2