Skip to content

Commit 2f5bfb4

Browse files
authored
[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)。
1 parent 2af2634 commit 2f5bfb4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

llvm/test/tools/llvm-objdump/ELF/AArch64/mattr.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
## When --mattr and --mcpu are both empty, disassemble all known instructions.
22
# RUN: llvm-mc -filetype=obj -triple=aarch64 -mattr=+all %s -o %t
33
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s --check-prefixes=CHECK,ALL
4+
# RUN: llvm-mc -filetype=obj -triple=aarch64_be -mattr=+all %s -o %t
5+
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s --check-prefixes=CHECK,ALL
6+
# RUN: llvm-mc -filetype=obj -triple=aarch64_32 -mattr=+all %s -o %t
7+
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s --check-prefixes=CHECK,ALL
48

59
## If --mattr or --mcpu is specified, don't default to --mattr=+all.
610
# RUN: llvm-objdump -d --no-show-raw-insn --mattr=+v8a %t | FileCheck %s --check-prefixes=CHECK,UNKNOWN

llvm/tools/llvm-objdump/llvm-objdump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2556,7 +2556,7 @@ static void disassembleObject(ObjectFile *Obj, bool InlineRelocs) {
25562556
if (!MAttrs.empty()) {
25572557
for (unsigned I = 0; I != MAttrs.size(); ++I)
25582558
Features.AddFeature(MAttrs[I]);
2559-
} else if (MCPU.empty() && Obj->getArch() == llvm::Triple::aarch64) {
2559+
} else if (MCPU.empty() && Obj->makeTriple().isAArch64()) {
25602560
Features.AddFeature("+all");
25612561
}
25622562

0 commit comments

Comments
 (0)