Merge changes I00616aae,I5f78ecc9
* changes:
vmbase: sections.ld: Fix bin_end as LMA
vmbase: example: Add bin_end to integration_test
diff --git a/vmbase/example/src/layout.rs b/vmbase/example/src/layout.rs
index 463738e..c0c4fab 100644
--- a/vmbase/example/src/layout.rs
+++ b/vmbase/example/src/layout.rs
@@ -81,6 +81,10 @@
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 @@
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 @@
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;
diff --git a/vmbase/sections.ld b/vmbase/sections.ld
index 88033e3..87b909d 100644
--- a/vmbase/sections.ld
+++ b/vmbase/sections.ld
@@ -80,7 +80,7 @@
data_lma = LOADADDR(.data);
/* Everything beyond this point will not be included in the binary. */
- bin_end = .;
+ bin_end = data_lma + SIZEOF(.data);
/* The entry point code assumes that .bss is 16-byte aligned. */
.bss : ALIGN(16) {