Skip to content

Commit b8bb1ee

Browse files
committed
Fix compilation on big-endian targets
1 parent 8cee9e8 commit b8bb1ee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/coff_import_file.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ pub(crate) const NULL_THUNK_DATA_SUFFIX: &[u8] = b"_NULL_THUNK_DATA";
3131

3232
macro_rules! u16 {
3333
($val:expr) => {
34-
object::U16::new(object::NativeEndian, $val)
34+
object::U16::new(object::LittleEndian, $val)
3535
};
3636
}
3737

3838
macro_rules! u32 {
3939
($val:expr) => {
40-
object::U32::new(object::NativeEndian, $val)
40+
object::U32::new(object::LittleEndian, $val)
4141
};
4242
}
4343

@@ -49,7 +49,7 @@ pub(crate) fn get_short_import_symbol(
4949
let mut offset = 0;
5050
let header = ImportObjectHeader::parse(buf, &mut offset).map_err(Error::other)?;
5151
let data = header.parse_data(buf, &mut offset).map_err(Error::other)?;
52-
let is_ec = header.machine.get(object::NativeEndian) == object::pe::IMAGE_FILE_MACHINE_ARM64EC;
52+
let is_ec = header.machine.get(object::LittleEndian) == object::pe::IMAGE_FILE_MACHINE_ARM64EC;
5353

5454
let name = data.symbol();
5555
let demangled_name = is_ec
@@ -77,7 +77,7 @@ pub(crate) fn get_short_import_symbol(
7777
f(demangled_name.as_ref())?;
7878

7979
// For Arm64EC, also the EC import symbol and thunk.
80-
if header.machine.get(object::NativeEndian) == object::pe::IMAGE_FILE_MACHINE_ARM64EC {
80+
if header.machine.get(object::LittleEndian) == object::pe::IMAGE_FILE_MACHINE_ARM64EC {
8181
const IMP_PREFIX: &[u8] = b"__imp_aux_";
8282
f(&IMP_PREFIX
8383
.iter()

0 commit comments

Comments
 (0)