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: https://github.com/llvm/llvm-project/pull/135123
This commit is contained in:
Peter Collingbourne 2025-04-10 10:38:59 -07:00 committed by GitHub
parent a4e6a771a6
commit f53eb88d25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -847,9 +847,8 @@ static void addRelativeReloc(Ctx &ctx, InputSectionBase &isec,
Partition &part = isec.getPartition(ctx);
if (sym.isTagged()) {
std::lock_guard<std::mutex> lock(ctx.relocMutex);
part.relaDyn->addRelativeReloc(ctx.target->relativeRel, isec, offsetInSec,
sym, addend, type, expr);
part.relaDyn->addRelativeReloc<shard>(ctx.target->relativeRel, isec,
offsetInSec, sym, addend, type, expr);
// With MTE globals, we always want to derive the address tag by `ldg`-ing
// the symbol. When we have a RELATIVE relocation though, we no longer have
// a reference to the symbol. Because of this, when we have an addend that