Skip to content

Commit

Permalink
feat(parser): Add more symbol binding.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Feb 9, 2023
1 parent dff4725 commit d6b1d4d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/parser/src/elf64/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ pub enum SymbolBinding {
Global = 0x01,
/// Global scope, but with lower precedence than global symbols.
Weak = 0x02,
/// Low environment-specific use.
LowEnvironmentSpecific = 0x0a,
/// High environment-specific use.
HighEnvironmentSpecific = 0x0c,
/// Low processor-specific use.
LowProcessorSpecific = 0x0d,
/// High processor-specific use.
HighProcessorSpecific = 0x0e,
}

impl SymbolBinding {
Expand All @@ -85,6 +93,10 @@ impl SymbolBinding {
0x00 => Self::Local,
0x01 => Self::Global,
0x02 => Self::Weak,
0x0a => Self::LowEnvironmentSpecific,
0x0c => Self::HighProcessorSpecific,
0x0d => Self::LowEnvironmentSpecific,
0x0e => Self::HighProcessorSpecific,
_ => return Err(Err::Error(E::from_error_kind(input, ErrorKind::Alt))),
},
))
Expand Down

0 comments on commit d6b1d4d

Please sign in to comment.