[PATCH] D144301: [dwarfdump][AMDGPU] Support EF_AMDGPU_MACH_NONE

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 14:16:05 PST 2023


scott.linder created this revision.
Herald added subscribers: kosarev, cmtice, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a reviewer: jhenderson.
Herald added a project: All.
scott.linder requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay, wdng.
Herald added a project: LLVM.

A quirk of the AMDGPU backend is EF_AMDGPU_MACH_NONE, which is not
specific to the r600 or amdgcn architecture, but can be combined with
either.

AMDGPU ELF code objects with this mach value cannot be mapped back
to a Triple architecture, as it could be either r600 or amdgcn. For
llvm-objdump this means the normal method of inspecting
ObjectFile::getArch to determine how to handle relocations is
insufficient.

This patch adds an extra check for ELF code objects which would
otherwise be categorized as UnknownArch, making it possible to use
llvm-objdump with them. For completeness it also adds support for known
r600 machines.

This also adds specific tests for llvm-objdump for amdgcn and r600, both
with known and unknown mach values.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144301

Files:
  llvm/lib/Object/RelocationResolver.cpp
  llvm/test/tools/llvm-dwarfdump/AMDGPU/known-amdgcn-relocs.yaml
  llvm/test/tools/llvm-dwarfdump/AMDGPU/known-r600-relocs.yaml
  llvm/test/tools/llvm-dwarfdump/AMDGPU/lit.local.cfg
  llvm/test/tools/llvm-dwarfdump/AMDGPU/unknown-amdgcn-relocs.yaml
  llvm/test/tools/llvm-dwarfdump/AMDGPU/unknown-r600-relocs.yaml

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144301.498506.patch
Type: text/x-patch
Size: 20351 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230217/fdb85e51/attachment.bin>


More information about the llvm-commits mailing list