[llvm] 2f5bfb4 - [llvm-objdump] Default to --mattr=+all for AArch64be and AArch64_32 (#118311)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 2 19:18:20 PST 2024
Author: hstk30-hw
Date: 2024-12-03T11:18:17+08:00
New Revision: 2f5bfb41e2e0c4178627a3492beed35f8143ce2f
URL: https://github.com/llvm/llvm-project/commit/2f5bfb41e2e0c4178627a3492beed35f8143ce2f
DIFF: https://github.com/llvm/llvm-project/commit/2f5bfb41e2e0c4178627a3492beed35f8143ce2f.diff
LOG: [llvm-objdump] Default to --mattr=+all for AArch64be and AArch64_32 (#118311)
GNU objdump disassembles all unknown instructions by default.
Complement for [D128030](https://reviews.llvm.org/D128030)。
Added:
Modified:
llvm/test/tools/llvm-objdump/ELF/AArch64/mattr.s
llvm/tools/llvm-objdump/llvm-objdump.cpp
Removed:
################################################################################
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");
}
More information about the llvm-commits
mailing list