Ocloc asm/disasm support for zebin

This commit adds option to disassemble and assemble zebinary.

Disasm disassembles zebinary into sections. Text sections are
translated to assembly, relocations and symbols are
translated into human readable format.

Asm assembles zebinary from files generated by disasm.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
Krystian Chmielewski
2022-08-23 15:20:14 +00:00
committed by Compute-Runtime-Automation
parent cdffa8619c
commit 4f0d19628e
17 changed files with 1781 additions and 64 deletions

View File

@@ -168,6 +168,23 @@ class ConstStringRef {
return ('\0' == *rhs);
}
constexpr bool startsWith(ConstStringRef subString) const noexcept {
if (subString.length() > len) {
return false;
}
const char *findEnd = ptr + subString.length();
const char *lhs = ptr;
const char *rhs = subString.begin();
while ((lhs < findEnd)) {
if (*lhs != *rhs) {
return false;
}
lhs++;
rhs++;
}
return true;
}
constexpr bool isEqualWithoutSeparator(const char separator, const char *subString) const noexcept {
const char *end = ptr + len;
const char *lhs = ptr;