[llvm] [llvm-objdump] Default to --mattr=+all for AArch64be and AArch64_32 (PR #118311)

via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 07:46:40 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-binary-utilities

Author: None (hstk30-hw)

<details>
<summary>Changes</summary>

GNU objdump disassembles all unknown instructions by default. 
Complement for [D128030](https://reviews.llvm.org/D128030)。

---
Full diff: https://github.com/llvm/llvm-project/pull/118311.diff


2 Files Affected:

- (modified) llvm/test/tools/llvm-objdump/ELF/AArch64/mattr.s (+4) 
- (modified) llvm/tools/llvm-objdump/llvm-objdump.cpp (+1-1) 


``````````diff
diff --git a/llvm/test/tools/llvm-objdump/ELF/AArch64/mattr.s b/llvm/test/tools/llvm-objdump/ELF/AArch64/mattr.s
index e236660770648a..5fd77b579984af 100644
--- a/llvm/test/tools/llvm-objdump/ELF/AArch64/mattr.s
+++ b/llvm/test/tools/llvm-objdump/ELF/AArch64/mattr.s
@@ -1,6 +1,10 @@
 ## When --mattr and --mcpu are both empty, disassemble all known instructions.
 # RUN: llvm-mc -filetype=obj -triple=aarch64 -mattr=+all %s -o %t
 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s --check-prefixes=CHECK,ALL
+# RUN: llvm-mc -filetype=obj -triple=aarch64_be -mattr=+all %s -o %t
+# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s --check-prefixes=CHECK,ALL
+# RUN: llvm-mc -filetype=obj -triple=aarch64_32 -mattr=+all %s -o %t
+# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s --check-prefixes=CHECK,ALL
 
 ## If --mattr or --mcpu is specified, don't default to --mattr=+all.
 # RUN: llvm-objdump -d --no-show-raw-insn --mattr=+v8a %t | FileCheck %s --check-prefixes=CHECK,UNKNOWN
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index 86ba9193dff2d1..246d5cfa05818a 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -2556,7 +2556,7 @@ static void disassembleObject(ObjectFile *Obj, bool InlineRelocs) {
   if (!MAttrs.empty()) {
     for (unsigned I = 0; I != MAttrs.size(); ++I)
       Features.AddFeature(MAttrs[I]);
-  } else if (MCPU.empty() && Obj->getArch() == llvm::Triple::aarch64) {
+  } else if (MCPU.empty() && Obj->makeTriple().isAArch64()) {
     Features.AddFeature("+all");
   }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/118311


More information about the llvm-commits mailing list