Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fef9bc6
multiboot2: elf_sections: add `elf` library into cargo.toml
an-owl Apr 8, 2026
9d2e015
multiboot2: self_sections: Fixed bug where `flags` truncated bits.
an-owl Apr 8, 2026
8c7e7e6
multiboot2: self_sections: Removed ElfSectionIter, replaced with `Sec…
an-owl Apr 8, 2026
b059c4d
multiboot2: self_sections: Implemented From to cast &ElfSectionsTag i…
an-owl Apr 9, 2026
7d58983
multiboot2: elf_sections: Removed hand-rolled elf types and replaced …
an-owl Apr 14, 2026
ba8a113
multiboot2: elf_sections: Added methods for getting the section name.
an-owl Apr 15, 2026
ef0f0b9
multiboot2: builder: Fixed bug in test `build_and_parse` where ElfSec…
an-owl Apr 15, 2026
698f270
multiboot2: lib: Fixed up unit tests for changes in elf_sections
an-owl Apr 15, 2026
7e4957f
integration tests: Fixed up integration tests for changes in elf_sect…
an-owl Apr 15, 2026
627bfb4
multiboot2: elf_sections: Replaced magic numbers with constants from …
an-owl Apr 15, 2026
9579bca
multiboot2: elf_sections: Added `UserDefined` section type to `ElfSec…
an-owl Apr 15, 2026
b70df61
multiboot2: elf_sections: Added `STRINGS` and `THREAD_LOCAL` flags to…
an-owl Apr 15, 2026
272f6f1
multiboot2: elf_sections: add `elf` library into cargo.toml
an-owl Apr 8, 2026
1531d25
multiboot2: self_sections: Fixed bug where `flags` truncated bits.
an-owl Apr 8, 2026
1242b28
multiboot2: self_sections: Removed ElfSectionIter, replaced with `Sec…
an-owl Apr 8, 2026
1495736
multiboot2: self_sections: Implemented From to cast &ElfSectionsTag i…
an-owl Apr 9, 2026
67d1427
multiboot2: elf_sections: Removed hand-rolled elf types and replaced …
an-owl Apr 14, 2026
928910a
multiboot2: elf_sections: Added methods for getting the section name.
an-owl Apr 15, 2026
36b10c9
multiboot2: builder: Fixed bug in test `build_and_parse` where ElfSec…
an-owl Apr 15, 2026
c1897ae
multiboot2: lib: Fixed up unit tests for changes in elf_sections
an-owl Apr 15, 2026
cc737c9
integration tests: Fixed up integration tests for changes in elf_sect…
an-owl Apr 15, 2026
282eeca
multiboot2: elf_sections: Replaced magic numbers with constants from …
an-owl Apr 15, 2026
0b8ca24
multiboot2: elf_sections: Added `UserDefined` section type to `ElfSec…
an-owl Apr 15, 2026
089a839
multiboot2: elf_sections: Added `STRINGS` and `THREAD_LOCAL` flags to…
an-owl Apr 15, 2026
2a55795
Updated CHANGELOG.md
an-owl Jun 10, 2026
e455889
multiboot2: Tweaked ElfSectionsExt docs
an-owl Jun 10, 2026
9b87c7a
multiboot2: elf_sections: Changed pointer cast to use `core::ptr::wit…
an-owl Jun 10, 2026
6039b98
Merge remote-tracking branch 'origin/elf' into elf
an-owl Jun 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package.license = "MIT/Apache-2.0"
[workspace.dependencies]
# Dependencies of multiboot2 et al.
bitflags = { version = "2.11", default-features = false }
elf = { version = "0.8", default-features = false }
log = { version = "~0.4", default-features = false }
ptr_meta = { version = "~0.3", default-features = false }
thiserror = { version = "2.0", default-features = false }
Expand Down
26 changes: 19 additions & 7 deletions integration-test/bins/multiboot2_payload/src/verify/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod grub;

use alloc::format;
use alloc::vec::Vec;
use multiboot2::BootInformation;
use multiboot2::{BootInformation, ElfSectionExt};

pub fn run(mbi: &BootInformation) -> anyhow::Result<()> {
println!("MBI: {mbi:#x?}");
Expand Down Expand Up @@ -52,20 +52,32 @@ pub(self) fn print_elf_info(mbi: &BootInformation) -> anyhow::Result<()> {
.ok_or("Should have elf sections")
.map(|tag| tag.sections())
.map_err(anyhow::Error::msg)?;
let string_table = mbi
.elf_sections_tag()
.ok_or("Should have elf sections")
.map(|tag| tag.string_table())
.map_err(anyhow::Error::msg)?
.ok_or("String table section should be present")
.map_err(anyhow::Error::msg)?;

println!("ELF sections:");
for s in sections_iter {
let typ = format!("{:?}", s.section_type());
let typ = format!("{:?}", s.sh_type);
let flags = format!("{:?}", s.flags());
let name = s.name().map_err(anyhow::Error::msg)?;
let name = s
.name_from_string_table(string_table)
.map_err(anyhow::Error::msg)?
.to_str()
.map_err(anyhow::Error::msg)?;
println!(
" {:<13} {:<17} {:<22} 0x{:010x} 0x{:010x} {:>5.2} MiB align={}",
name,
typ,
flags,
s.start_address(),
s.end_address(),
s.size() as f32 / 1024.0,
s.addralign(),
s.sh_addr,
s.sh_addr + s.sh_size,
s.sh_size as f32 / 1024.0,
s.sh_addralign,
);
}
println!();
Expand Down
9 changes: 9 additions & 0 deletions multiboot2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
## Unreleased

- **Breaking**: Renamed `VBEWindowAttributes::WRITABLE` (fix typo)
- **Breaking** Changed `multiboot2::elf_sections` to use the [elf](https://docs.rs/elf/latest/elf/) crate
- `ElfSectionsTag::sections()` now returns an iterator over `elf::section::SectionHeader`.
- `ElfSection` has been removed and replaced with `elf::section::SectionHeader`.
- Added `ElfSectionExt` trait to replace functionality for `ElfSection::flags()`,
`ElfSection::section_type()`, and `ElfSection::name()`.
- Added `ElfSectionsTag::string_table()`.
- Added some flags to `ElfSectionFlags`.
- Added UserDefined section to `ElfSectionType`.
- Fixed some bugs.

## v0.24.1 (2025-11-21)

Expand Down
1 change: 1 addition & 0 deletions multiboot2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ builder = ["alloc", "multiboot2-common/builder"]

[dependencies]
bitflags = { workspace = true }
elf = { workspace = true }
log = { workspace = true }
multiboot2-common = { workspace = true }
ptr_meta = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion multiboot2/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ mod tests {
8,
FramebufferType::Text,
))
.elf_sections(ElfSectionsTag::new(0, 32, 0, &[]))
.elf_sections(ElfSectionsTag::new(0, 40, 0, &[]))
.apm(ApmTag::new(0, 0, 0, 0, 0, 0, 0, 0, 0))
.efi32(EFISdt32Tag::new(0x1000))
.efi64(EFISdt64Tag::new(0x1000))
Expand Down
Loading
Loading