From e786ecfcf9ede4cbaa3db548a4c9dac71b2904bf Mon Sep 17 00:00:00 2001 From: Christopher Cole Date: Thu, 26 Jan 2023 13:47:05 -0800 Subject: [PATCH] Add C-style definitions for Elf[32|64]_Dyn --- src/dynamic.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/dynamic.rs b/src/dynamic.rs index f767b07..64f46d2 100644 --- a/src/dynamic.rs +++ b/src/dynamic.rs @@ -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,