comparison python/ppci/linker.py @ 377:9667d78ba79e

Switched to xml for project description
author Windel Bouwman
date Fri, 11 Apr 2014 15:47:50 +0200
parents 98ff43cfdd36
children 6df89163e114
comparison
equal deleted inserted replaced
376:1e951e71d3f1 377:9667d78ba79e
128 section.data[reloc.offset+2] = (offset >> 16) & 0xFF 128 section.data[reloc.offset+2] = (offset >> 16) & 0xFF
129 section.data[reloc.offset+1] = (offset >> 8) & 0xFF 129 section.data[reloc.offset+1] = (offset >> 8) & 0xFF
130 section.data[reloc.offset+0] = offset & 0xFF 130 section.data[reloc.offset+0] = offset & 0xFF
131 131
132 132
133 class Layout:
134 pass
135
133 class Linker: 136 class Linker:
134 """ Merges the sections of several object files and 137 """ Merges the sections of several object files and
135 performs relocation """ 138 performs relocation """
136 def __init__(self): 139 def __init__(self):
137 self.logger = logging.getLogger('Linker') 140 self.logger = logging.getLogger('Linker')
138 141
139 def link(self, objs, layout={}): 142 def link(self, objs, layout={}):
143 assert type(objs) is list
140 # Create new object file to store output: 144 # Create new object file to store output:
141 self.dst = ObjectFile() 145 self.dst = ObjectFile()
142 146
143 # Create sections with address: 147 # Create sections with address:
144 for section_name, address in layout.items(): 148 for section_name, address in layout.items():