Skip to content

Commit c8ff968

Browse files
committed
[BOLT][AArch64] add lock to FixRelaxations pass
Since the pass is multithreaded, BC.Ctx must be protected. Otherwise we get crashes when processing. Reviewed by: yota9 Differential Revision: https://reviews.llvm.org/D141465
1 parent 6f00e11 commit c8ff968

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bolt/lib/Passes/FixRelaxationPass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ void FixRelaxations::runOnFunction(BinaryFunction &BF) {
3939
if (!Symbol || AdrpSymbol == Symbol)
4040
continue;
4141

42+
auto L = BC.scopeLock();
4243
const int64_t Addend = BC.MIB->getTargetAddend(Add);
4344
BC.MIB->setOperandToSymbolRef(Adrp, /*OpNum*/ 1, Symbol, Addend,
4445
BC.Ctx.get(), ELF::R_AARCH64_NONE);

0 commit comments

Comments
 (0)