浏览代码

Add start_address and end_address methods to ElfSection too

Philipp Oppermann 9 年之前
父节点
当前提交
33d19ac1bb
共有 1 个文件被更改,包括 8 次插入0 次删除
  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)
     }