Skip to content

Commit

Permalink
read/elf: change NoteIterator::new to public (gimli-rs#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipc authored Apr 12, 2023
1 parent 803bcef commit 85437f0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/read/elf/note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ impl<'data, Elf> NoteIterator<'data, Elf>
where
Elf: FileHeader,
{
/// An iterator over the notes in an ELF section or segment.
///
/// `align` should be from the `p_align` field of the segment,
/// or the `sh_addralign` field of the section. Supported values are
/// either 4 or 8, but values less than 4 are treated as 4.
/// This matches the behaviour of binutils.
///
/// Returns `Err` if `align` is invalid.
pub(super) fn new(
endian: Elf::Endian,
align: Elf::Word,
data: &'data [u8],
) -> read::Result<Self> {
pub fn new(endian: Elf::Endian, align: Elf::Word, data: &'data [u8]) -> read::Result<Self> {
let align = match align.into() {
0u64..=4 => 4,
8 => 8,
Expand Down

0 comments on commit 85437f0

Please sign in to comment.