Mercurial > lcfOS
annotate python/ppci/linker.py @ 334:6f4753202b9a
Added more recipes
author | Windel Bouwman |
---|---|
date | Thu, 13 Feb 2014 22:02:08 +0100 |
parents | |
children | 582a1aaa3983 |
rev | line source |
---|---|
334 | 1 |
2 from .objectfile import ObjectFile | |
3 | |
4 class Linker: | |
5 def set_symbol(self, sym): | |
6 self.dst.add_symbol(sym.name, sym.value) | |
7 | |
8 def link(self, objs): | |
9 self.dst = ObjectFile() | |
10 # First copy all sections into output sections: | |
11 for iobj in objs: | |
12 for sym in iobj.symbols: | |
13 print(sym) | |
14 self.set_symbol(sym) | |
15 # Do relocations: | |
16 # TODO | |
17 # Check that there are no more unresolved symbols: | |
18 # TODO | |
19 return self.dst |