Struct elfkit::elf::Elf [−][src]
pub struct Elf { pub header: Header, pub segments: Vec<SegmentHeader>, pub sections: Vec<Section>, }
Fields
header: Header
segments: Vec<SegmentHeader>
sections: Vec<Section>
Methods
impl Elf
[src]
impl Elf
pub fn from_header(header: Header) -> Self
[src]
pub fn from_header(header: Header) -> Self
pub fn from_reader<R>(io: &mut R) -> Result<Elf, Error> where
R: Read + Seek,
[src]
pub fn from_reader<R>(io: &mut R) -> Result<Elf, Error> where
R: Read + Seek,
pub fn load<R>(&mut self, i: usize, io: &mut R) -> Result<(), Error> where
R: Read + Seek,
[src]
pub fn load<R>(&mut self, i: usize, io: &mut R) -> Result<(), Error> where
R: Read + Seek,
pub fn load_all<R>(&mut self, 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,
pub fn sync_all(&mut self) -> Result<(), Error>
[src]
pub fn sync_all(&mut self) -> Result<(), Error>
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 to_writer<R>(&mut self, io: R) -> Result<(), Error> where
R: Write + Seek,
pub fn make_symtab_gnuld_compat(&mut self) -> Result<(), Error>
[src]
pub fn make_symtab_gnuld_compat(&mut self) -> Result<(), Error>
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]
pub fn reorder(self: &mut Elf) -> Result<HashMap<usize, usize>, Error>
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 layout(self: &mut Elf) -> Result<(), Error>
pub fn remove_section(&mut self, at: usize) -> Result<Section, Error>
[src]
pub fn remove_section(&mut self, at: usize) -> Result<Section, Error>
pub fn insert_section(&mut self, at: usize, sec: Section) -> Result<(), Error>
[src]
pub fn insert_section(&mut self, at: usize, sec: Section) -> Result<(), Error>
pub fn move_section(&mut self, from: usize, to: usize) -> Result<(), Error>
[src]
pub fn move_section(&mut self, from: usize, to: usize) -> Result<(), Error>