fix: improve propagating external functions info to kernel

When relocation points to symbol that is not defined within module mark
it as optional. When symbol is available at dynamic linking time then
info from the function is retrieved but when the symbol is not available
then ignore the dependency.

Any unresolved symbol needed for module linking is already handled
in a separate place.

Related-To: NEO-16243, NEO-16263, NEO-16262, NEO-16268
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 a440a3e8ea
commit 15d0feeda8
8 changed files with 127 additions and 29 deletions

View File

@@ -37,6 +37,9 @@ uint32_t getExtFuncDependencies(const FuncNameToIdMapT &funcNameToId, const Func
auto funcDep = funcDependencies[i];
if (funcNameToId.count(funcDep->callerFuncName) == 0 ||
funcNameToId.count(funcDep->usedFuncName) == 0) {
if (funcDep->optional) {
continue;
}
return ERROR_EXTERNAL_FUNCTION_INFO_MISSING;
}
size_t callerId = funcNameToId.at(funcDep->callerFuncName);
@@ -75,6 +78,9 @@ uint32_t resolveExtFuncDependencies(const ExternalFunctionInfosT &externalFuncti
uint32_t resolveKernelDependencies(const ExternalFunctionInfosT &externalFunctionInfos, const FuncNameToIdMapT &funcNameToId, const KernelDependenciesT &kernelDependencies, const KernelDescriptorMapT &nameToKernelDescriptor) {
for (auto &kernelDep : kernelDependencies) {
if (funcNameToId.count(kernelDep->usedFuncName) == 0) {
if (kernelDep->optional) {
continue;
}
return ERROR_EXTERNAL_FUNCTION_INFO_MISSING;
} else if (nameToKernelDescriptor.count(kernelDep->kernelName) == 0) {
return ERROR_KERNEL_DESCRIPTOR_MISSING;