Skip to content

Commit

Permalink
Initial Xtensa support
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Nov 2, 2022
1 parent e04e85d commit cee32b4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub enum Architecture {
S390x,
Sparc64,
Wasm32,
Xtensa,
}

impl Architecture {
Expand Down Expand Up @@ -52,6 +53,7 @@ impl Architecture {
Architecture::S390x => Some(AddressSize::U64),
Architecture::Sparc64 => Some(AddressSize::U64),
Architecture::Wasm32 => Some(AddressSize::U32),
Architecture::Xtensa => Some(AddressSize::U32),
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/read/elf/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ where
// We only support the 64-bit variant s390x here.
(elf::EM_S390, true) => Architecture::S390x,
(elf::EM_SPARCV9, true) => Architecture::Sparc64,
(elf::EM_XTENSA, false) => Architecture::Xtensa,
_ => Architecture::Unknown,
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/write/elf/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ impl<'a> Object<'a> {
Architecture::Riscv32 => true,
Architecture::S390x => true,
Architecture::Sparc64 => true,
Architecture::Xtensa => true,
_ => {
return Err(Error(format!(
"unimplemented architecture {:?}",
Expand Down Expand Up @@ -281,6 +282,7 @@ impl<'a> Object<'a> {
Architecture::Riscv64 => elf::EM_RISCV,
Architecture::S390x => elf::EM_S390,
Architecture::Sparc64 => elf::EM_SPARCV9,
Architecture::Xtensa => elf::EM_XTENSA,
_ => {
return Err(Error(format!(
"unimplemented architecture {:?}",
Expand Down

0 comments on commit cee32b4

Please sign in to comment.