arch-arm: Handle empty object_file scenario in ArmFsWorkload
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Wed, 1 Apr 2020 16:19:49 +0000 (17:19 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 14 Apr 2020 08:51:24 +0000 (08:51 +0000)
At the moment it is actually possible to pass en empty object file
to the ArmFsWorkload (OsKernel) class. We need to handle this
situation as well.
In case no bootloader nor object file is passed, we default to
AArch64 (default value for ArmFsWorkload)

Change-Id: I3b4aa8b8d61a8fac08da218125984b3bb1d38fb9
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27707
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
src/arch/arm/fs_workload.cc

index 3d81156214cc63b78d8ee5729e743a51c49f1680..8f40293ebfd9d03683c82361b9975589a594002e 100644 (file)
@@ -96,7 +96,7 @@ FsWorkload::FsWorkload(Params *p)
         bootldr->loadGlobalSymbols(debugSymbolTable);
 
         _highestELIs64 = (bootldr->getArch() == ObjectFile::Arm64);
-    } else {
+    } else if (obj) {
         _highestELIs64 = (obj->getArch() == ObjectFile::Arm64);
     }
 }