From 339b9e071741f926a745e1a1fff706e8a852b99a Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 8 Jul 2020 18:26:16 +0100 Subject: [PATCH] switch assembler to little-endian --- src/soc/simulator/program.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/soc/simulator/program.py b/src/soc/simulator/program.py index 4cf9b9ff..2f3d88b3 100644 --- a/src/soc/simulator/program.py +++ b/src/soc/simulator/program.py @@ -13,9 +13,15 @@ import sys filedir = os.path.dirname(os.path.realpath(__file__)) memmap = os.path.join(filedir, "memmap") -bigendian = True -endian_fmt = "elf64-big" -obj_fmt = "-be" +bigendian = False +if bigendian: + endian_fmt = "elf64-big" + obj_fmt = "-be" + ld_fmt = "-EB" +else: + ld_fmt = "-EL" + endian_fmt = "elf64-little" + obj_fmt = "-le" class Program: @@ -49,6 +55,7 @@ class Program: def _link(self, ofile): with tempfile.NamedTemporaryFile(suffix=".elf") as elffile: args = ["powerpc64-linux-gnu-ld", + ld_fmt, "-o", elffile.name, "-T", memmap, ofile.name] -- 2.30.2