[BOLT] Do not process DWARF relocs

Summary:
Use the new API introduced in https://reviews.llvm.org/D106624
to request LLVM do not process relocations for debug sections, since
BOLT processes final binaries that are already relocated.

(cherry picked from FBD31449206)
This commit is contained in:
Rafael Auler 2021-10-06 13:03:56 -07:00 committed by Maksim Panchenko
parent 8ef3b27834
commit a8cbc8093f
2 changed files with 5 additions and 5 deletions

View File

@ -883,7 +883,7 @@ std::unique_ptr<BinaryContext>
createDwarfOnlyBC(const object::ObjectFile &File) { createDwarfOnlyBC(const object::ObjectFile &File) {
return BinaryContext::createBinaryContext( return BinaryContext::createBinaryContext(
&File, false, &File, false,
DWARFContext::create(File, DWARFContext::ProcessDebugRelocations::Process, DWARFContext::create(File, DWARFContext::ProcessDebugRelocations::Ignore,
nullptr, "", WithColor::defaultErrorHandler, nullptr, "", WithColor::defaultErrorHandler,
WithColor::defaultWarningHandler)); WithColor::defaultWarningHandler));
} }

View File

@ -494,10 +494,10 @@ RewriteInstance::RewriteInstance(ELFObjectFileBase *File, const int Argc,
BC = BinaryContext::createBinaryContext( BC = BinaryContext::createBinaryContext(
File, IsPIC, File, IsPIC,
DWARFContext::create( DWARFContext::create(*File, DWARFContext::ProcessDebugRelocations::Ignore,
*File, DWARFContext::ProcessDebugRelocations::Process, nullptr, nullptr, opts::DWPPathName,
opts::DWPPathName, WithColor::defaultErrorHandler, WithColor::defaultErrorHandler,
WithColor::defaultWarningHandler)); WithColor::defaultWarningHandler));
BAT = std::make_unique<BoltAddressTranslation>(*BC); BAT = std::make_unique<BoltAddressTranslation>(*BC);