From 9a86f6083536ddce6ee50ae0e20d08a28a4b85be Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 13 Apr 2017 17:54:06 +0200 Subject: [PATCH] Print kernel ELF sections --- src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 433b0515..23c0fb9e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,6 +27,15 @@ pub extern fn rust_main(multiboot_information_address: usize) { area.base_addr, area.length); } + let elf_sections_tag = boot_info.elf_sections_tag() + .expect("Elf-sections tag required"); + + println!("kernel sections:"); + for section in elf_sections_tag.sections() { + println!(" addr: 0x{:x}, size: 0x{:x}, flags: 0x{:x}", + section.addr, section.size, section.flags); + } + loop{} }