[PATCH] D80512: [MC] Changes to help improve target specific symbol disassembly

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 25 10:42:37 PDT 2020


MaskRay added a comment.

> This commit slightly modifies the MCDisassembler, and llvm-objdump to allow targets to also decode entire symbols.

What does "decode entire symbols" mean?



================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1397
 
-      if (Obj->isELF() && Obj->getArch() == Triple::amdgcn) {
-        if (Symbols[SI].Type == ELF::STT_AMDGPU_HSA_KERNEL) {
-          // skip amd_kernel_code_t at the begining of kernel symbol (256 bytes)
-          Start += 256;
-        }
-        if (SI == SE - 1 ||
-            Symbols[SI + 1].Type == ELF::STT_AMDGPU_HSA_KERNEL) {
-          // cut trailing zeroes at the end of kernel
-          // cut up to 256 bytes
-          const uint64_t EndAlign = 256;
-          const auto Limit = End - (std::min)(EndAlign, End - Start);
-          while (End > Limit &&
-            *reinterpret_cast<const support::ulittle32_t*>(&Bytes[End - 4]) == 0)
-            End -= 4;
-        }
-      }
+      // if (Obj->isELF() && Obj->getArch() == Triple::amdgcn) {
+      //   if (Symbols[SI].Type == ELF::STT_AMDGPU_HSA_KERNEL) {
----------------
This breaks `test/CodeGen/AMDGPU/nop-data.ll`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80512/new/

https://reviews.llvm.org/D80512





More information about the llvm-commits mailing list