Skip to content

Commit bdbb293

Browse files
committed
Add offset to Section
1 parent 7c424a7 commit bdbb293

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

objdiff-core/src/obj/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ pub struct Section {
7070
pub id: String,
7171
pub name: String,
7272
pub address: u64,
73+
pub offset: Option<u64>,
7374
pub size: u64,
7475
pub kind: SectionKind,
7576
pub data: SectionData,
@@ -414,6 +415,7 @@ static DUMMY_SECTION: Section = Section {
414415
id: String::new(),
415416
name: String::new(),
416417
address: 0,
418+
offset: None,
417419
size: 0,
418420
kind: SectionKind::Unknown,
419421
data: SectionData(Vec::new()),

objdiff-core/src/obj/read.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ fn map_sections(
273273
id,
274274
name: name.to_string(),
275275
address: section.address(),
276+
offset: section.file_range().map(|(start, _)| start),
276277
size: section.size(),
277278
kind,
278279
data: SectionData(data),

0 commit comments

Comments
 (0)