7b72c1b786
* SWDEV-517078 - Maintain the trap handler ABI version in CLR The trap handler ABI version is communicated to the debugger using the r_version field in the r_debug structure. This structure is an external dependency, which makes it complicated to keep the trap handler source (in CRL) and the ABI version number (external dependency) in sync. This patch proposes to patch the trap handler ABI version number in _amdgpu_r_debug before communicating it to the debugger. We can't directly include sc's executable.hpp file in CRL as it relies on conflicting definition of ELF related types, so instead we need to rely on a-priori knowledge on the r_debug structure. Fortunately, this structure is part of a stable ABI, so its layout is guaranteed to be kept stable. Update the 2nd level trap handler to follow updates from the ROCr-runtime. The trap handlers are stripped from parts dedicated to architectures unsupported by CLR. Bump the r_debug.r_version to track the ABI changes in the trap handler.