// CHECK-NEXT: Code alignment factor: 1
// CHECK-NEXT: Data alignment factor: -8
// CHECK-NEXT: Return address column: 16
-// CHECK-NEXT: Personality Address: 0000000000001029
+// CHECK-NEXT: Personality Address: 000000000000127c
// CHECK-NEXT: Augmentation data:
// CHECK: DW_CFA_def_cfa: reg7 +8
// CHECK-NEXT: DW_CFA_nop:
/// FIXME Handle relocation correctly
-// CHECK: 00000020 00000014 00000024 FDE cie=00000000 pc=0000103c...0000103c
+// CHECK: 00000020 00000014 00000024 FDE cie=00000000 pc=0000127c...0000127c
// CHECK-NEXT: Format: DWARF32
-// CHECK-NEXT: LSDA Address: 000000000000100b
+// CHECK-NEXT: LSDA Address: 000000000000127c
// CHECK-NEXT: DW_CFA_nop:
// CHECK-NEXT: DW_CFA_nop:
// CHECK-NEXT: DW_CFA_nop:
if (DebugFrame)
return DebugFrame.get();
+ const DWARFSection &DS = DObj->getFrameSection();
+
// There's a "bug" in the DWARFv3 standard with respect to the target address
// size within debug frame sections. While DWARF is supposed to be independent
// of its container, FDEs have fields with size being "target address size",
// provides this information). This problem is fixed in DWARFv4
// See this dwarf-discuss discussion for more details:
// http://lists.dwarfstd.org/htdig.cgi/dwarf-discuss-dwarfstd.org/2011-December/001173.html
- DWARFDataExtractor debugFrameData(*DObj, DObj->getFrameSection(),
- isLittleEndian(), DObj->getAddressSize());
- auto DF = std::make_unique<DWARFDebugFrame>(getArch(), /*IsEH=*/false);
- if (Error E = DF->parse(debugFrameData))
+ DWARFDataExtractor DebugFrameData(*DObj, DS, isLittleEndian(),
+ DObj->getAddressSize());
+ auto DF =
+ std::make_unique<DWARFDebugFrame>(getArch(), /*IsEH=*/false, DS.Address);
+ if (Error E = DF->parse(DebugFrameData))
return std::move(E);
DebugFrame.swap(DF);
if (EHFrame)
return EHFrame.get();
- DWARFDataExtractor debugFrameData(*DObj, DObj->getEHFrameSection(),
- isLittleEndian(), DObj->getAddressSize());
+ const DWARFSection &DS = DObj->getEHFrameSection();
+ DWARFDataExtractor DebugFrameData(*DObj, DS, isLittleEndian(),
+ DObj->getAddressSize());
- auto DF = std::make_unique<DWARFDebugFrame>(getArch(), /*IsEH=*/true);
- if (Error E = DF->parse(debugFrameData))
+ auto DF =
+ std::make_unique<DWARFDebugFrame>(getArch(), /*IsEH=*/true, DS.Address);
+ if (Error E = DF->parse(DebugFrameData))
return std::move(E);
DebugFrame.swap(DF);
return DebugFrame.get();
if (Name == "debug_ranges") {
// FIXME: Use the other dwo range section when we emit it.
RangesDWOSection.Data = Data;
+ } else if (Name == "debug_frame" || Name == "eh_frame") {
+ if (DWARFSection *S = mapNameToDWARFSection(Name))
+ S->Address = Section.getAddress();
}
} else if (InfoSectionMap *Sections =
StringSwitch<InfoSectionMap *>(Name)