-
Notifications
You must be signed in to change notification settings - Fork 13.7k
ELF: Remove lock from MTE global relocation handling code. #135123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ELF: Remove lock from MTE global relocation handling code. #135123
Conversation
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
@llvm/pr-subscribers-lld Author: Peter Collingbourne (pcc) ChangesThis lock is unnecessary because we can add the relocations to Full diff: https://github.com/llvm/llvm-project/pull/135123.diff 1 Files Affected:
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 81de664fd1c23..277acb26987bc 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -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
|
@llvm/pr-subscribers-lld-elf Author: Peter Collingbourne (pcc) ChangesThis lock is unnecessary because we can add the relocations to Full diff: https://github.com/llvm/llvm-project/pull/135123.diff 1 Files Affected:
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 81de664fd1c23..277acb26987bc 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -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
|
Created using spr 1.3.6-beta.1 [skip ci]
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/llvm-project#135123
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
This lock is unnecessary because we can add the relocations to
shards and let them be sorted later.