summaryrefslogtreecommitdiff
path: root/src/core/loader/elf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/loader/elf.cpp')
-rw-r--r--src/core/loader/elf.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp
index f4a339390..627c18c7e 100644
--- a/src/core/loader/elf.cpp
+++ b/src/core/loader/elf.cpp
@@ -364,21 +364,24 @@ SectionID ElfReader::GetSectionByName(const char* name, int firstSection) const
364 364
365namespace Loader { 365namespace Loader {
366 366
367AppLoader_ELF::AppLoader_ELF(FileSys::VirtualFile file) : AppLoader(std::move(file)) {} 367AppLoader_ELF::AppLoader_ELF(FileSys::VirtualFile file_) : AppLoader(std::move(file_)) {}
368 368
369FileType AppLoader_ELF::IdentifyType(const FileSys::VirtualFile& file) { 369FileType AppLoader_ELF::IdentifyType(const FileSys::VirtualFile& elf_file) {
370 static constexpr u16 ELF_MACHINE_ARM{0x28}; 370 static constexpr u16 ELF_MACHINE_ARM{0x28};
371 371
372 u32 magic = 0; 372 u32 magic = 0;
373 if (4 != file->ReadObject(&magic)) 373 if (4 != elf_file->ReadObject(&magic)) {
374 return FileType::Error; 374 return FileType::Error;
375 }
375 376
376 u16 machine = 0; 377 u16 machine = 0;
377 if (2 != file->ReadObject(&machine, 18)) 378 if (2 != elf_file->ReadObject(&machine, 18)) {
378 return FileType::Error; 379 return FileType::Error;
380 }
379 381
380 if (Common::MakeMagic('\x7f', 'E', 'L', 'F') == magic && ELF_MACHINE_ARM == machine) 382 if (Common::MakeMagic('\x7f', 'E', 'L', 'F') == magic && ELF_MACHINE_ARM == machine) {
381 return FileType::ELF; 383 return FileType::ELF;
384 }
382 385
383 return FileType::Error; 386 return FileType::Error;
384} 387}