fix: improve parsing relocations in external usage

ignore relocations for symbols with undefined section

Related-To: NEO-16243
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2025-09-26 12:21:34 +00:00
committed by Compute-Runtime-Automation
parent ce65d34a8f
commit 65d883bc9d
5 changed files with 35 additions and 23 deletions

View File

@@ -232,6 +232,7 @@ bool LinkerInput::addSymbol(Elf::Elf<numBits> &elf, const SectionNameToSegmentId
auto symbolSectionName = elf.getSectionName(elfSymbol.shndx);
auto segment = getSegmentForSection(symbolSectionName);
if (segment == SegmentType::unknown) {
externalSymbols.push_back(symbolName);
return false;
}
@@ -311,10 +312,9 @@ void LinkerInput::parseRelocationForExtFuncUsage(const RelocationInfo &relocInfo
return true;
}
for (auto specialRelocationName : {implicitArgsRelocationSymbolName, Linker::perThreadOff, Linker::subDeviceID}) {
if (relocInfo.symbolName == specialRelocationName) {
return true;
}
// ignore relocations for external symbols
if (std::ranges::find(externalSymbols, relocInfo.symbolName) != externalSymbols.end()) {
return true;
}
return false;
};