Skip to content

Commit e7c0e59

Browse files
authored
[BOLT] Fix crash for relocs in data sections against ABS symbols (#76026)
Fixes #75771
1 parent 9bda1de commit e7c0e59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2524,7 +2524,7 @@ void RewriteInstance::handleRelocation(const SectionRef &RelocatedSection,
25242524
Expected<StringRef> SectionName = Section->getName();
25252525
if (SectionName && !SectionName->empty())
25262526
ReferencedSection = BC->getUniqueSectionByName(*SectionName);
2527-
} else if (ReferencedSymbol &&
2527+
} else if (ReferencedSymbol && ContainingBF &&
25282528
(cantFail(Symbol.getFlags()) & SymbolRef::SF_Absolute)) {
25292529
// This might be a relocation for an ABS symbols like __global_pointer$ on
25302530
// RISC-V

0 commit comments

Comments
 (0)