forked from OSchip/llvm-project
[BOLT][NFC] Remove RewriteInstance::EHFrame
(cherry picked from FBD27915725)
This commit is contained in:
parent
f84f451a54
commit
3355936e14
|
@ -1603,13 +1603,15 @@ void RewriteInstance::readSpecialSections() {
|
||||||
<< "relocation mode\n";
|
<< "relocation mode\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process debug sections.
|
// Read EH frame for function boundaries info.
|
||||||
EHFrame = cantFail(BC->DwCtx->getEHFrame());
|
Expected<const DWARFDebugFrame *> EHFrameOrError = BC->DwCtx->getEHFrame();
|
||||||
|
if (!EHFrameOrError)
|
||||||
|
report_error("expected valid eh_frame section", EHFrameOrError.takeError());
|
||||||
if (opts::DumpEHFrame) {
|
if (opts::DumpEHFrame) {
|
||||||
outs() << "BOLT-INFO: Dumping original binary .eh_frame\n";
|
outs() << "BOLT-INFO: Dumping original binary .eh_frame\n";
|
||||||
EHFrame->dump(outs(), DIDumpOptions(), &*BC->MRI, NoneType());
|
EHFrameOrError.get()->dump(outs(), DIDumpOptions(), &*BC->MRI, NoneType());
|
||||||
}
|
}
|
||||||
CFIRdWrt.reset(new CFIReaderWriter(*EHFrame));
|
CFIRdWrt.reset(new CFIReaderWriter(*EHFrameOrError.get()));
|
||||||
|
|
||||||
// Parse build-id
|
// Parse build-id
|
||||||
parseBuildID();
|
parseBuildID();
|
||||||
|
@ -5014,7 +5016,7 @@ void RewriteInstance::rewriteFile() {
|
||||||
|
|
||||||
if (auto *E = dyn_cast<ELFObjectFileBase>(&Binary)) {
|
if (auto *E = dyn_cast<ELFObjectFileBase>(&Binary)) {
|
||||||
std::unique_ptr<DWARFContext> DwCtx = DWARFContext::create(*E);
|
std::unique_ptr<DWARFContext> DwCtx = DWARFContext::create(*E);
|
||||||
const DWARFDebugFrame *const &EHFrame = cantFail(DwCtx->getEHFrame());
|
const DWARFDebugFrame *EHFrame = cantFail(DwCtx->getEHFrame());
|
||||||
outs() << "BOLT-INFO: Dumping rewritten .eh_frame\n";
|
outs() << "BOLT-INFO: Dumping rewritten .eh_frame\n";
|
||||||
EHFrame->dump(outs(), DIDumpOptions(), &*BC->MRI, NoneType());
|
EHFrame->dump(outs(), DIDumpOptions(), &*BC->MRI, NoneType());
|
||||||
}
|
}
|
||||||
|
|
|
@ -446,7 +446,6 @@ private:
|
||||||
|
|
||||||
/// Exception handling and stack unwinding information in this binary.
|
/// Exception handling and stack unwinding information in this binary.
|
||||||
ErrorOr<BinarySection &> LSDASection{std::errc::bad_address};
|
ErrorOr<BinarySection &> LSDASection{std::errc::bad_address};
|
||||||
const llvm::DWARFDebugFrame *EHFrame{nullptr};
|
|
||||||
ErrorOr<BinarySection &> EHFrameSection{std::errc::bad_address};
|
ErrorOr<BinarySection &> EHFrameSection{std::errc::bad_address};
|
||||||
|
|
||||||
/// .plt section.
|
/// .plt section.
|
||||||
|
|
Loading…
Reference in New Issue