Browse Source

Add start_address and end_address methods to ElfSection too

Philipp Oppermann 9 years ago
parent
commit
33d19ac1bb
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/elf_sections.rs

+ 8 - 0
src/elf_sections.rs

@@ -62,6 +62,14 @@ pub struct ElfSection {
 }
 
 impl ElfSection {
+    pub fn start_address(&self) -> usize {
+        self.addr as usize
+    }
+
+    pub fn end_address(&self) -> usize {
+        (self.addr + self.size) as usize
+    }
+
     pub fn flags(&self) -> ElfSectionFlags {
         ElfSectionFlags::from_bits_truncate(self.flags)
     }