Skip to content

Commit df00507

Browse files
pccvar-const
authored andcommitted
ELF: Remove lock from MTE global relocation handling code.
This lock is unnecessary because we can add the relocations to shards and let them be sorted later. Reviewers: smithp35, fmayer, MaskRay Reviewed By: MaskRay Pull Request: llvm#135123
1 parent ebfa6ca commit df00507

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lld/ELF/Relocations.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,9 +847,8 @@ static void addRelativeReloc(Ctx &ctx, InputSectionBase &isec,
847847
Partition &part = isec.getPartition(ctx);
848848

849849
if (sym.isTagged()) {
850-
std::lock_guard<std::mutex> lock(ctx.relocMutex);
851-
part.relaDyn->addRelativeReloc(ctx.target->relativeRel, isec, offsetInSec,
852-
sym, addend, type, expr);
850+
part.relaDyn->addRelativeReloc<shard>(ctx.target->relativeRel, isec,
851+
offsetInSec, sym, addend, type, expr);
853852
// With MTE globals, we always want to derive the address tag by `ldg`-ing
854853
// the symbol. When we have a RELATIVE relocation though, we no longer have
855854
// a reference to the symbol. Because of this, when we have an addend that

0 commit comments

Comments
 (0)