bin2hex: Make sure to generate little endian files
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 1 Jun 2020 08:24:15 +0000 (18:24 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 2 Jun 2020 09:56:08 +0000 (19:56 +1000)
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
scripts/bin2hex.py

index af278bc91fa6800b68fc05712d1b0323278cb670..cd732cbe34b33416283fc807bd8b3b575e5f0096 100755 (executable)
@@ -8,9 +8,9 @@ with open(sys.argv[1], "rb") as f:
         while True:
             word = f.read(8)
             if len(word) == 8:
-                print("%016x" % struct.unpack('Q', word));
+                print("%016x" % struct.unpack('<Q', word));
             elif len(word) == 4:
-                print("00000000%08x" % struct.unpack('I', word));
+                print("00000000%08x" % struct.unpack('<I', word));
             elif len(word) == 0:
                 exit(0);
             else: