summaryrefslogtreecommitdiff
path: root/src/elf.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/elf.rs')
-rw-r--r--src/elf.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/elf.rs b/src/elf.rs
index 2a51082..41ce491 100644
--- a/src/elf.rs
+++ b/src/elf.rs
@@ -373,6 +373,18 @@ impl From<u8> for SymbolType {
}
}
+impl From<SymbolType> for u8 {
+ fn from(x: SymbolType) -> Self {
+ use SymbolType::*;
+ match x {
+ Function => STT_FUNC,
+ Object => STT_OBJECT,
+ Section => STT_SECTION,
+ Other(x) => x,
+ }
+ }
+}
+
#[derive(Debug, Copy, Clone)]
pub enum SymbolValue {
Undefined,