mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
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:
committed by
Compute-Runtime-Automation
parent
ce65d34a8f
commit
65d883bc9d
@@ -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;
|
||||
};
|
||||
|
||||
@@ -183,6 +183,7 @@ struct LinkerInput : NEO::NonCopyableAndNonMovableClass {
|
||||
|
||||
Traits traits;
|
||||
SymbolMap symbols;
|
||||
std::vector<std::string> externalSymbols;
|
||||
std::vector<std::pair<std::string, SymbolInfo>> extFuncSymbols;
|
||||
Relocations dataRelocations;
|
||||
RelocationsPerInstSegment textRelocations;
|
||||
|
||||
Reference in New Issue
Block a user