Mercurial > lcfOS
diff python/ppci/buildtasks.py @ 383:173e20a47fda
Added linker description loader
author | Windel Bouwman |
---|---|
date | Sun, 27 Apr 2014 17:40:39 +0200 |
parents | 6df89163e114 |
children | d056b552d3f4 |
line wrap: on
line diff
--- a/python/ppci/buildtasks.py Sun Apr 27 12:24:21 2014 +0200 +++ b/python/ppci/buildtasks.py Sun Apr 27 17:40:39 2014 +0200 @@ -5,7 +5,6 @@ """ import logging -import json from .tasks import Task, TaskError, register_task from .buildfunctions import c3compile, link, assemble @@ -78,31 +77,11 @@ output.save(f) -def make_num(txt): - if txt.startswith('0x'): - return int(txt[2:], 16) - else: - return int(txt) - - -def load_layout(filename): - """ Load a linker layout file which contains directives where sections - must be placed into memory. """ - try: - with open(filename, 'r') as f: - layout = json.load(f) - except OSError as e: - raise TaskError(str(e)) - for s in layout: - layout[s] = make_num(layout[s]) - return layout - - @register_task("link") class LinkTask(Task): """ Link together a collection of object files """ def run(self): - layout = load_layout(self.relpath(self.get_argument('layout'))) + layout = self.relpath(self.get_argument('layout')) objects = self.open_file_set(self.get_argument('objects')) output_file = self.relpath(self.get_argument('output'))