Skip to content

Commit

Permalink
Use repr(C) for all Pod types
Browse files Browse the repository at this point in the history
  • Loading branch information
philipc committed Dec 29, 2016
1 parent 4716753 commit e1f518d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use core::fmt;
use {P32, P64};
use zero::Pod;

#[derive(Debug)]
#[repr(C)]
pub struct Dynamic<P> {
tag: Tag_<P>,
un: P,
Expand Down
2 changes: 2 additions & 0 deletions src/hash.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use symbol_table::Entry;
use zero::Pod;

#[derive(Debug)]
#[repr(C)]
pub struct HashTable {
bucket_count: u32,
chain_count: u32,
Expand Down
2 changes: 2 additions & 0 deletions src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ impl<'a> fmt::Display for HeaderPt2<'a> {
}
}

#[derive(Debug)]
#[repr(C)]
pub struct HeaderPt2_<P> {
pub type_: Type_,
pub machine: Machine,
Expand Down
2 changes: 2 additions & 0 deletions src/sections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,15 @@ pub const GRP_MASKOS: u64 = 0x0ff00000;
pub const GRP_MASKPROC: u64 = 0xf0000000;

#[derive(Debug)]
#[repr(C)]
pub struct Rela<P> {
offset: P,
info: P,
addend: P,
}

#[derive(Debug)]
#[repr(C)]
pub struct Rel<P> {
offset: P,
info: P,
Expand Down

0 comments on commit e1f518d

Please sign in to comment.