[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) {
return BinaryContext::createBinaryContext(
&File, false,
DWARFContext::create(File, DWARFContext::ProcessDebugRelocations::Process,
DWARFContext::create(File, DWARFContext::ProcessDebugRelocations::Ignore,
nullptr, "", WithColor::defaultErrorHandler,
WithColor::defaultWarningHandler));
}

View File

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