Changeset 3447 in CLRX


Ignore:
Timestamp:
Sep 29, 2017, 7:43:18 AM (3 years ago)
Author:
matszpk
Message:

CLRadeonExtender: GalliumBin?: Throw exception when kernel symbol not found or it has wrong section or wrong binding.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdbin/GalliumBinaries.cpp

    r3446 r3447  
    185185    {
    186186        const GalliumKernel& kernel = kernels[i];
    187         const size_t symIndex = elfBinary.getSymbolIndex(kernel.kernelName.c_str());
     187        size_t symIndex = 0;
     188        try
     189        { symIndex = elfBinary.getSymbolIndex(kernel.kernelName.c_str()); }
     190        catch(const Exception& ex)
     191        { throw Exception("Kernel symbol not found"); }
    188192        const auto& sym = elfBinary.getSymbol(symIndex);
    189193        const char* symName = elfBinary.getSymbolName(symIndex);
     
    199203                            "offset doesn't match");
    200204        }
     205        else
     206            throw Exception("Wrong section or binding for kernel symbol");
    201207    }
    202208}
Note: See TracChangeset for help on using the changeset viewer.