diff options
author | Job Noorman <jnoorman@igalia.com> | 2024-02-07 07:53:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-07 07:53:02 +0000 |
commit | e7c0e59bbcf713d09ca7a09cd513399d66a94ca5 (patch) | |
tree | 6b65df0df1f15e8703e7e4290c80791f0554fbe7 /bolt | |
parent | 9bda1de0b6096d26e87fed18cb681cc3e5b8319a (diff) | |
download | llvm-e7c0e59bbcf713d09ca7a09cd513399d66a94ca5.zip llvm-e7c0e59bbcf713d09ca7a09cd513399d66a94ca5.tar.gz llvm-e7c0e59bbcf713d09ca7a09cd513399d66a94ca5.tar.bz2 |
[BOLT] Fix crash for relocs in data sections against ABS symbols (#76026)
Fixes #75771
Diffstat (limited to 'bolt')
-rw-r--r-- | bolt/lib/Rewrite/RewriteInstance.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 0fa5dce..9a242d9 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -2524,7 +2524,7 @@ void RewriteInstance::handleRelocation(const SectionRef &RelocatedSection, Expected<StringRef> SectionName = Section->getName(); if (SectionName && !SectionName->empty()) ReferencedSection = BC->getUniqueSectionByName(*SectionName); - } else if (ReferencedSymbol && + } else if (ReferencedSymbol && ContainingBF && (cantFail(Symbol.getFlags()) & SymbolRef::SF_Absolute)) { // This might be a relocation for an ABS symbols like __global_pointer$ on // RISC-V |