diff --git a/src/loader/mod.rs b/src/loader/mod.rs index 818ff0ae..d0750ca1 100644 --- a/src/loader/mod.rs +++ b/src/loader/mod.rs @@ -544,6 +544,12 @@ mod test { v } + #[cfg(feature = "elf")] + #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] + fn make_elfnote() -> Vec { + include_bytes!("test_elfnote.bin").to_vec() + } + #[allow(safe_packed_borrows)] #[allow(non_snake_case)] #[test] @@ -664,6 +670,14 @@ mod test { Some(highmem_start_address) ) ); + + let pvhnote_image = make_elfnote(); + loader_result = Elf::load(&gm, None, &mut Cursor::new(&pvhnote_image), None).unwrap(); + println!( + "PVH entry point at address {:8x} \n", + loader_result.pvh_entry_addr.unwrap().raw_value() + ); + assert_eq!(loader_result.pvh_entry_addr.unwrap().raw_value(), 0x1e1fe1f); } #[test] diff --git a/src/loader/test_elfnote.bin b/src/loader/test_elfnote.bin new file mode 100755 index 00000000..98a07644 Binary files /dev/null and b/src/loader/test_elfnote.bin differ