[llvm] 5c7566c - [llvm-objdump] Add --no-addresses as an alias for --no-leading-addr
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 4 10:01:38 PDT 2022
Author: Fangrui Song
Date: 2022-10-04T10:01:30-07:00
New Revision: 5c7566cd05970fafa5d93b192ca36c4c4b114f72
URL: https://github.com/llvm/llvm-project/commit/5c7566cd05970fafa5d93b192ca36c4c4b114f72
DIFF: https://github.com/llvm/llvm-project/commit/5c7566cd05970fafa5d93b192ca36c4c4b114f72.diff
LOG: [llvm-objdump] Add --no-addresses as an alias for --no-leading-addr
The output is similar to objdump --no-addresses since binutils 2.35.
Depends on D135039
Close #58088
Differential Revision: https://reviews.llvm.org/D135040
Added:
Modified:
llvm/docs/CommandGuide/llvm-objdump.rst
llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs-exec.test
llvm/test/tools/llvm-objdump/X86/print-symbol-addr.s
llvm/tools/llvm-objdump/ObjdumpOpts.td
Removed:
################################################################################
diff --git a/llvm/docs/CommandGuide/llvm-objdump.rst b/llvm/docs/CommandGuide/llvm-objdump.rst
index d6d1d805e3cb..654a48fe7572 100644
--- a/llvm/docs/CommandGuide/llvm-objdump.rst
+++ b/llvm/docs/CommandGuide/llvm-objdump.rst
@@ -184,7 +184,7 @@ OPTIONS
Enable/disable target-specific attributes. Specify ``--mattr=help`` to display
the available attributes.
-.. option:: --no-leading-addr
+.. option:: --no-leading-addr, --no-addresses
When disassembling, do not print leading addresses for instructions or inline
relocations.
diff --git a/llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs-exec.test b/llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs-exec.test
index 5d78b7a372ce..4fe0bb75dbf4 100644
--- a/llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs-exec.test
+++ b/llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs-exec.test
@@ -3,6 +3,7 @@
# RUN: yaml2obj --docnum=1 %s -o %t
# RUN: llvm-objdump -dr %t | FileCheck %s --match-full-lines --strict-whitespace
# RUN: llvm-objdump -dr --no-leading-addr %t | FileCheck %s --check-prefix=NOADDR --match-full-lines --strict-whitespace
+# RUN: llvm-objdump -dr --no-addresses %t | FileCheck %s --check-prefix=NOADDR --match-full-lines --strict-whitespace
# RUN: yaml2obj -DBITS=32 %s -o %t.32
# RUN: llvm-objdump -dr --no-leading-addr %t.32 | FileCheck %s --check-prefix=NOADDR --match-full-lines --strict-whitespace
diff --git a/llvm/test/tools/llvm-objdump/X86/print-symbol-addr.s b/llvm/test/tools/llvm-objdump/X86/print-symbol-addr.s
index 95023f35918f..12cc8e57e0bd 100644
--- a/llvm/test/tools/llvm-objdump/X86/print-symbol-addr.s
+++ b/llvm/test/tools/llvm-objdump/X86/print-symbol-addr.s
@@ -24,6 +24,8 @@
# RUN: llvm-objdump -d --no-leading-addr %t.64.o > %t.64.txt
# RUN: FileCheck --input-file=%t.32.txt %s --check-prefix=NOADDR --match-full-lines --strict-whitespace
# RUN: FileCheck --input-file=%t.64.txt %s --check-prefix=NOADDR --match-full-lines --strict-whitespace
+# RUN: llvm-objdump -d --no-addresses %t.32.o |
diff %t.32.txt -
+# RUN: llvm-objdump -d --no-addresses %t.64.o |
diff %t.64.txt -
# NOADDR:<foo>:
# NOADDR-NEXT: 90{{ +}} nop
diff --git a/llvm/tools/llvm-objdump/ObjdumpOpts.td b/llvm/tools/llvm-objdump/ObjdumpOpts.td
index 4537c34287ae..178267dc408c 100644
--- a/llvm/tools/llvm-objdump/ObjdumpOpts.td
+++ b/llvm/tools/llvm-objdump/ObjdumpOpts.td
@@ -130,6 +130,7 @@ def no_show_raw_insn : Flag<["--"], "no-show-raw-insn">,
def no_leading_addr : Flag<["--"], "no-leading-addr">,
HelpText<"When disassembling, do not print leading addresses for instructions or inline relocations">;
+def : Flag<["--"], "no-addresses">, Alias<no_leading_addr>;
def raw_clang_ast : Flag<["--"], "raw-clang-ast">,
HelpText<"Dump the raw binary contents of the clang AST section">;
More information about the llvm-commits
mailing list