mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-26 15:03:02 +08:00
fix: correct elf decoder section name getter
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
de93bc6928
commit
f2d5e73f72
@@ -64,8 +64,12 @@ struct Elf {
|
||||
}
|
||||
|
||||
MOCKABLE_VIRTUAL std::string getSectionName(uint32_t id) const {
|
||||
auto sectionHeaderNamesData = sectionHeaders[elfFileHeader->shStrNdx].data;
|
||||
return std::string(reinterpret_cast<const char *>(sectionHeaderNamesData.begin()) + sectionHeaders[id].header->name);
|
||||
if (sectionHeaders.size() > id && sectionHeaders.size() > elfFileHeader->shStrNdx) {
|
||||
auto sectionHeaderNamesData = sectionHeaders[elfFileHeader->shStrNdx].data;
|
||||
return std::string(reinterpret_cast<const char *>(sectionHeaderNamesData.begin()) + sectionHeaders[id].header->name);
|
||||
} else {
|
||||
return std::string("");
|
||||
}
|
||||
}
|
||||
|
||||
MOCKABLE_VIRTUAL std::string getSymbolName(uint32_t nameOffset) const {
|
||||
|
||||
Reference in New Issue
Block a user