52a53
> #include "base/loader/object_file.hh"
63a65,105
> namespace
> {
>
> class ArmLinuxObjectFileLoader : public ObjectFile::Loader
> {
> public:
> Process *
> load(ProcessParams *params, ObjectFile *obj_file) override
> {
> auto arch = obj_file->getArch();
> auto opsys = obj_file->getOpSys();
>
> if (arch != ObjectFile::Arm && arch != ObjectFile::Thumb &&
> arch != ObjectFile::Arm64) {
> return nullptr;
> }
>
> if (opsys == ObjectFile::UnknownOpSys) {
> warn("Unknown operating system; assuming Linux.");
> opsys = ObjectFile::Linux;
> }
>
> if (opsys == ObjectFile::LinuxArmOABI) {
> fatal("gem5 does not support ARM OABI binaries. Please recompile "
> "with an EABI compiler.");
> }
>
> if (opsys != ObjectFile::Linux)
> return nullptr;
>
> if (arch == ObjectFile::Arm64)
> return new ArmLinuxProcess64(params, obj_file, arch);
> else
> return new ArmLinuxProcess32(params, obj_file, arch);
> }
> };
>
> ArmLinuxObjectFileLoader loader;
>
> } // anonymous namespace
>