diff python/ppci/outstream.py @ 381:6df89163e114

Fix section and ldr pseudo instruction
author Windel Bouwman
date Sat, 26 Apr 2014 17:41:56 +0200
parents 39bf68bf1891
children
line wrap: on
line diff
--- a/python/ppci/outstream.py	Fri Apr 18 13:08:45 2014 +0200
+++ b/python/ppci/outstream.py	Sat Apr 26 17:41:56 2014 +0200
@@ -23,6 +23,7 @@
     def __init__(self, obj_file):
         super().__init__()
         self.obj_file = obj_file
+        self.literal_pool = []
 
     def emit(self, item):
         """ Encode instruction and add symbol and relocation information """
@@ -83,3 +84,11 @@
     def select_section(self, sname):
         for output_stream in self.substreams:
             output_stream.select_section(sname)
+
+
+def BinaryAndLoggingStream(output):
+    """ Create a stream object that both logs and writes to an object file """
+    o2 = BinaryOutputStream(output)
+    o1 = LoggerOutputStream()
+    ostream = MasterOutputStream([o1, o2])
+    return ostream