Add C-style definitions for Elf[32|64]_Sym

This commit is contained in:
Christopher Cole 2023-01-26 13:06:13 -08:00
parent 8ed49b6a4c
commit ee705369b0
No known key found for this signature in database
GPG Key ID: 0AC856975983E9DB

View File

@ -6,6 +6,32 @@ use crate::parse::{ParseAt, ParseError, ParsingTable};
pub type SymbolTable<'data, E> = ParsingTable<'data, E, Symbol>;
/// C-style 32-bit ELF Symbol definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[repr(C)]
pub struct Elf32_Sym {
pub st_name: u32,
pub st_value: u32,
pub st_size: u32,
pub st_info: u8,
pub st_other: u8,
pub st_shndx: u32,
}
/// C-style 64-bit ELF Symbol definition
///
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
#[repr(C)]
pub struct Elf64_Sym {
pub st_name: u32,
pub st_info: u8,
pub st_other: u8,
pub st_shndx: u16,
pub st_value: u64,
pub st_size: u64,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Symbol {
/// This member holds an index into the symbol table's string table,