Skip to content

Commit

Permalink
Add C-style definitions for Elf[32|64]_Dyn
Browse files Browse the repository at this point in the history
  • Loading branch information
cole14 committed Jan 26, 2023
1 parent ff57f74 commit e786ecf
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ use crate::parse::{ParseAt, ParseError, ParsingTable};

pub type DynamicTable<'data, E> = ParsingTable<'data, E, Dyn>;

/// C-style 32-bit ELF Dynamic section entry definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[repr(C)]
pub struct Elf32_Dyn {
pub d_tag: i32,
// union of both {d_val, d_ptr}
pub d_un: u32,
}

/// C-style 64-bit ELF Dynamic section entry definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[repr(C)]
pub struct Elf64_Dyn {
pub d_tag: i64,
// union of both {d_val, d_ptr}
pub d_un: u64,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Dyn {
pub d_tag: i64,
Expand Down

0 comments on commit e786ecf

Please sign in to comment.