diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /vendor/object/src/read/mod.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/object/src/read/mod.rs')
-rw-r--r-- | vendor/object/src/read/mod.rs | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/vendor/object/src/read/mod.rs b/vendor/object/src/read/mod.rs index 41d344111..91a5c05a5 100644 --- a/vendor/object/src/read/mod.rs +++ b/vendor/object/src/read/mod.rs @@ -22,7 +22,8 @@ pub use util::*; feature = "elf", feature = "macho", feature = "pe", - feature = "wasm" + feature = "wasm", + feature = "xcoff" ))] mod any; #[cfg(any( @@ -30,7 +31,8 @@ mod any; feature = "elf", feature = "macho", feature = "pe", - feature = "wasm" + feature = "wasm", + feature = "xcoff" ))] pub use any::*; @@ -49,12 +51,15 @@ pub mod macho; #[cfg(feature = "pe")] pub mod pe; -mod traits; -pub use traits::*; - #[cfg(feature = "wasm")] pub mod wasm; +#[cfg(feature = "xcoff")] +pub mod xcoff; + +mod traits; +pub use traits::*; + mod private { pub trait Sealed {} } @@ -176,6 +181,12 @@ pub enum FileKind { /// A Wasm file. #[cfg(feature = "wasm")] Wasm, + /// A 32-bit XCOFF file. + #[cfg(feature = "xcoff")] + Xcoff32, + /// A 64-bit XCOFF file. + #[cfg(feature = "xcoff")] + Xcoff64, } impl FileKind { @@ -236,6 +247,10 @@ impl FileKind { | [0x4c, 0x01, ..] // COFF x86-64 | [0x64, 0x86, ..] => FileKind::Coff, + #[cfg(feature = "xcoff")] + [0x01, 0xDF, ..] => FileKind::Xcoff32, + #[cfg(feature = "xcoff")] + [0x01, 0xF7, ..] => FileKind::Xcoff64, _ => return Err(Error("Unknown file magic")), }; Ok(kind) |