[][src]Struct elfkit::elf::Elf

pub struct Elf {
    pub header: Header,
    pub segments: Vec<SegmentHeader>,
    pub sections: Vec<Section>,
}

Fields

header: Headersegments: Vec<SegmentHeader>sections: Vec<Section>

Methods

impl Elf[src]

pub fn from_header(header: Header) -> Self[src]

pub fn from_reader<R>(io: &mut R) -> Result<Elf, Error> where
    R: Read + Seek
[src]

pub fn load<R>(&mut self, i: usize, io: &mut R) -> Result<(), Error> where
    R: Read + Seek
[src]

pub fn load_all<R>(&mut self, io: &mut R) -> Result<(), Error> where
    R: Read + Seek
[src]

pub fn sync_all(&mut self) -> Result<(), Error>[src]

write out everything to linked sections, such as string tables after calling this function, size() is reliable for all sections

pub fn to_writer<R>(&mut self, io: R) -> Result<(), Error> where
    R: Write + Seek
[src]

pub fn make_symtab_gnuld_compat(&mut self) -> Result<(), Error>[src]

gnu ld compatibility. this is very inefficent, but not doing this might break some GNU tools that rely on specific gnu-ld behaviour

  • reorder symbols to have GLOBAL last
  • remove original SECTION symbols and add offset to reloc addend instead
  • insert new symbol sections on the top

pub fn reorder(self: &mut Elf) -> Result<HashMap<usize, usize>, Error>[src]

reorder to minimize segmentation will only reorder sections that come after the last locked section

pub fn layout(self: &mut Elf) -> Result<(), Error>[src]

pub fn remove_section(&mut self, at: usize) -> Result<Section, Error>[src]

pub fn insert_section(&mut self, at: usize, sec: Section) -> Result<(), Error>[src]

pub fn move_section(&mut self, from: usize, to: usize) -> Result<(), Error>[src]

Trait Implementations

impl Default for Elf[src]

Auto Trait Implementations

impl Send for Elf

impl Sync for Elf

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]