From 35e9c1e17e7347392f3119a6db01ab654c8fc707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Cl=C3=A9ment=20Tosi?= Date: Fri, 14 Oct 2022 18:42:38 +0100 Subject: [PATCH] vmbase: example: Add bin_end to integration_test Print the linker variable in the test. Bug: 238050226 Test: atest vmbase_example.integration_test Change-Id: I5f78ecc9864bcf2c2def8b4b670425b631ed454c --- vmbase/example/src/layout.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vmbase/example/src/layout.rs b/vmbase/example/src/layout.rs index 463738e8..c0c4fab2 100644 --- a/vmbase/example/src/layout.rs +++ b/vmbase/example/src/layout.rs @@ -81,6 +81,10 @@ fn data_load_address() -> VirtualAddress { unsafe { VirtualAddress(&data_lma as *const u8 as usize) } } +fn binary_end() -> VirtualAddress { + unsafe { VirtualAddress(&bin_end as *const u8 as usize) } +} + pub fn print_addresses() { let dtb = dtb_range(); println!("dtb: {}..{} ({} bytes)", dtb.start, dtb.end, dtb.end - dtb.start); @@ -88,6 +92,7 @@ pub fn print_addresses() { println!("text: {}..{} ({} bytes)", text.start, text.end, text.end - text.start); let rodata = rodata_range(); println!("rodata: {}..{} ({} bytes)", rodata.start, rodata.end, rodata.end - rodata.start); + println!("binary end: {}", binary_end()); let data = data_range(); println!( "data: {}..{} ({} bytes, loaded at {})", @@ -132,6 +137,7 @@ extern "C" { static data_begin: u8; static data_end: u8; static data_lma: u8; + static bin_end: u8; static bss_begin: u8; static bss_end: u8; static boot_stack_begin: u8;