diff python/ppci/linker.py @ 348:442fb043d149

Added log option to zcc
author Windel Bouwman
date Sat, 08 Mar 2014 15:32:33 +0100
parents b4882ff0ed06
children 2b02bd286fe9
line wrap: on
line diff
--- a/python/ppci/linker.py	Fri Mar 07 17:05:32 2014 +0100
+++ b/python/ppci/linker.py	Sat Mar 08 15:32:33 2014 +0100
@@ -1,4 +1,4 @@
-
+import logging
 import struct
 from .objectfile import ObjectFile
 from . import CompilerError
@@ -92,6 +92,9 @@
 class Linker:
     """ Merges the sections of several object files and 
         performs relocation """
+    def __init__(self):
+        self.logger = logging.getLogger('Linker')
+
     def link(self, objs, layout={}):
         # Create new object file to store output:
         self.dst = ObjectFile()
@@ -113,7 +116,7 @@
                 # Add new section:
                 offsets[in_s.name] = out_s.Size
                 out_s.add_data(in_s.data)
-
+                self.logger.debug('{} {}({})'.format(offsets[in_s.name], iobj, in_s.name))
 
             # Merge symbols:
             for sym in iobj.symbols.values():