Skip to content

Commit

Permalink
Add basic support for mips64/powerpc/powerpc64/riscv64
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed May 20, 2021
1 parent d62fdb3 commit a3761e5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ pub enum Architecture {
Arm,
I386,
Mips,
Mips64,
S390x,
Wasm32,
PowerPc,
PowerPc64,
Riscv64,
X86_64,
}

Expand All @@ -23,9 +27,13 @@ impl Architecture {
Architecture::Arm => Some(AddressSize::U32),
Architecture::I386 => Some(AddressSize::U32),
Architecture::Mips => Some(AddressSize::U32),
Architecture::Mips64 => Some(AddressSize::U64),
Architecture::S390x => Some(AddressSize::U64),
Architecture::Wasm32 => Some(AddressSize::U32),
Architecture::X86_64 => Some(AddressSize::U64),
Architecture::PowerPc => Some(AddressSize::U32),
Architecture::PowerPc64 => Some(AddressSize::U64),
Architecture::Riscv64 => Some(AddressSize::U64),
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/write/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ impl Object {
Architecture::X86_64 => true,
Architecture::S390x => true,
Architecture::Mips => false,
Architecture::Mips64 => false,
Architecture::PowerPc => false,
Architecture::PowerPc64 => false,
Architecture::Riscv64 => false,
_ => {
return Err(Error(format!(
"unimplemented architecture {:?}",
Expand Down Expand Up @@ -349,6 +353,10 @@ impl Object {
Architecture::X86_64 => elf::EM_X86_64,
Architecture::S390x => elf::EM_S390,
Architecture::Mips => elf::EM_MIPS,
Architecture::Mips64 => elf::EM_MIPS,
Architecture::PowerPc => elf::EM_PPC,
Architecture::PowerPc64 => elf::EM_PPC64,
Architecture::Riscv64 => elf::EM_RISCV,
_ => {
return Err(Error(format!(
"unimplemented architecture {:?}",
Expand Down

0 comments on commit a3761e5

Please sign in to comment.