Skip to content

Commit

Permalink
nxo: Allow target machine ARM
Browse files Browse the repository at this point in the history
Required to build AArch32 NSO/NRO
  • Loading branch information
Thomas Guillemard committed May 9, 2019
1 parent 7dfc219 commit f87eee9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/format/nxo.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use elf;
use elf::types::{EM_AARCH64, ProgramHeader, PT_LOAD, SHT_NOTE};
use elf::types::{EM_ARM, EM_AARCH64, ProgramHeader, PT_LOAD, SHT_NOTE};
use crate::format::{utils, romfs::RomFs, nacp::NacpFile};
use std;
use std::fs::File;
Expand Down Expand Up @@ -59,8 +59,8 @@ impl NxoFile {

let elf_file = elf::File::open_stream(&mut file).unwrap();

if elf_file.ehdr.machine != EM_AARCH64 {
println!("Error: Invalid ELF file (expected AArch64 machine)");
if elf_file.ehdr.machine != EM_AARCH64 && elf_file.ehdr.machine != EM_ARM {
println!("Error: Invalid ELF file (expected ARM or AArch64 machine)");
process::exit(1)
}

Expand Down

0 comments on commit f87eee9

Please sign in to comment.