Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various cleanups. #36

Merged
merged 1 commit into from
Dec 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 4 additions & 3 deletions src/elf_sections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl ElfSectionsTag {
}
}

#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct ElfSectionIter {
current_section: *const u8,
remaining_sections: u32,
Expand Down Expand Up @@ -78,14 +78,15 @@ impl Iterator for ElfSectionIter {
}
}

#[derive(Debug)]
pub struct ElfSection {
inner: *const u8,
string_section: *const u8,
entry_size: u32,
}

#[derive(Debug)]
#[repr(C)]
#[repr(C, packed)]
struct ElfSectionInner32 {
name_index: u32,
typ: u32,
Expand All @@ -100,7 +101,7 @@ struct ElfSectionInner32 {
}

#[derive(Debug)]
#[repr(C)]
#[repr(C, packed)]
struct ElfSectionInner64 {
name_index: u32,
typ: u32,
Expand Down
4 changes: 3 additions & 1 deletion src/header.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#[repr(C)]
#[derive(Debug)]
#[repr(C, packed)]
pub struct Tag {
pub typ: u32,
pub size: u32,
// tag specific fields
}

#[derive(Debug)]
pub struct TagIter {
pub current: *const Tag,
}
Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#![no_std]

#![deny(missing_debug_implementations)]

use core::fmt;

use header::{Tag, TagIter};
Expand Down Expand Up @@ -33,7 +35,7 @@ pub struct BootInformation {
inner: *const BootInformationInner,
}

#[repr(C)]
#[repr(C, packed)]
struct BootInformationInner {
total_size: u32,
_reserved: u32,
Expand Down
3 changes: 2 additions & 1 deletion src/module.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use header::{Tag, TagIter};

#[repr(packed)]
#[derive(Debug)]
#[repr(C, packed)]
pub struct ModuleTag {
typ: u32,
size: u32,
Expand Down Expand Up @@ -36,6 +36,7 @@ pub fn module_iter(iter: TagIter) -> ModuleIter {
ModuleIter { iter: iter }
}

#[derive(Debug)]
pub struct ModuleIter {
iter: TagIter,
}
Expand Down