diff --git a/src/common.rs b/src/common.rs index baee92353..4bff76738 100644 --- a/src/common.rs +++ b/src/common.rs @@ -306,6 +306,9 @@ impl SectionId { SectionId::DebugAbbrev => ".debug_abbrev.dwo", SectionId::DebugInfo => ".debug_info.dwo", SectionId::DebugLine => ".debug_line.dwo", + // The debug_loc section can be present in the dwo when using the + // GNU split-dwarf extension to DWARF4. + SectionId::DebugLoc => ".debug_loc.dwo", SectionId::DebugLocLists => ".debug_loclists.dwo", SectionId::DebugMacro => ".debug_macro.dwo", SectionId::DebugStr => ".debug_str.dwo", diff --git a/src/read/dwarf.rs b/src/read/dwarf.rs index 34048a104..dfc3b56b9 100644 --- a/src/read/dwarf.rs +++ b/src/read/dwarf.rs @@ -639,6 +639,15 @@ impl Unit { pub fn entries_raw(&self, offset: Option>) -> Result> { self.header.entries_raw(&self.abbreviations, offset) } + + /// Copy attributes that are subject to relocation from another unit. This is intended + /// to be used to copy attributes from a skeleton compilation unit to the corresponding + /// split compilation unit. + pub fn copy_relocated_attributes(&mut self, other: &Unit) { + self.low_pc = other.low_pc; + self.addr_base = other.addr_base; + self.rnglists_base = other.rnglists_base; + } } impl UnitSectionOffset {