feat(dbg zebin): set sym value to absolute address

GDB requires debug zebin to be an absolute ELF. This change adds setting
symbols values to absolute addresses allowing GDB to work correctly.

Resolves: NEO-7097

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
Krystian Chmielewski
2022-06-10 15:56:01 +00:00
committed by Compute-Runtime-Automation
parent 5dc14eb46a
commit adfc3a1e7a
3 changed files with 155 additions and 73 deletions

View File

@@ -49,13 +49,14 @@ class DebugZebinCreator {
protected:
void applyRelocation(uint64_t addr, uint64_t value, NEO::Elf::RELOC_TYPE_ZEBIN type);
const Segments::Segment *getSegmentByName(ConstStringRef sectionName);
const Segments::Segment *getTextSegmentByName(ConstStringRef sectionName);
bool isRelocTypeSupported(NEO::Elf::RELOC_TYPE_ZEBIN type);
const Segments::Segment *getSegmentByName(ConstStringRef sectionName);
const Segments::Segment *getTextSegmentByName(ConstStringRef textSegmentName);
std::vector<uint8_t> debugZebin;
const Segments &segments;
Elf &zebin;
const Elf &zebin;
uint32_t symTabShndx = std::numeric_limits<uint32_t>::max();
std::vector<uint8_t> debugZebin;
};
std::vector<uint8_t> createDebugZebin(ArrayRef<const uint8_t> zebin, const Segments &segmentData);