mirror of
https://github.com/encounter/objdiff.git
synced 2025-07-03 11:45:57 +00:00
Unwrap code section in arm.rs
This commit is contained in:
parent
0f9dd7ed41
commit
71de77681c
@ -1,6 +1,6 @@
|
|||||||
use std::{borrow::Cow, collections::HashMap};
|
use std::{borrow::Cow, collections::HashMap};
|
||||||
|
|
||||||
use anyhow::{bail, Result};
|
use anyhow::{anyhow, bail, Result};
|
||||||
use armv5te::{arm, thumb};
|
use armv5te::{arm, thumb};
|
||||||
use object::{
|
use object::{
|
||||||
elf, File, Object, ObjectSection, ObjectSymbol, Relocation, RelocationFlags, SectionIndex,
|
elf, File, Object, ObjectSection, ObjectSymbol, Relocation, RelocationFlags, SectionIndex,
|
||||||
@ -51,6 +51,7 @@ impl ObjArch for ObjArchArm {
|
|||||||
config: &DiffObjConfig,
|
config: &DiffObjConfig,
|
||||||
) -> Result<ProcessCodeResult> {
|
) -> Result<ProcessCodeResult> {
|
||||||
let (section, symbol) = obj.section_symbol(symbol_ref);
|
let (section, symbol) = obj.section_symbol(symbol_ref);
|
||||||
|
let section = section.ok_or_else(|| anyhow!("Code symbol section not found"))?;
|
||||||
let mut code = §ion.data
|
let mut code = §ion.data
|
||||||
[symbol.section_address as usize..(symbol.section_address + symbol.size) as usize];
|
[symbol.section_address as usize..(symbol.section_address + symbol.size) as usize];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user