]> granicus.if.org Git - llvm/commitdiff
[llvm-objdump] - llvm-objdump can skip bytes at the end of a section.
authorSid Manning <sidneym@quicinc.org>
Fri, 1 Feb 2019 19:11:47 +0000 (19:11 +0000)
committerSid Manning <sidneym@quicinc.org>
Fri, 1 Feb 2019 19:11:47 +0000 (19:11 +0000)
Differential Revision: https://reviews.llvm.org/D57549

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352900 91177308-0d34-0410-b5e6-96231b3b80d8

test/tools/llvm-objdump/X86/disasm-text.test [new file with mode: 0644]
tools/llvm-objdump/llvm-objdump.cpp

diff --git a/test/tools/llvm-objdump/X86/disasm-text.test b/test/tools/llvm-objdump/X86/disasm-text.test
new file mode 100644 (file)
index 0000000..38422d8
--- /dev/null
@@ -0,0 +1,11 @@
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o -| \
+# RUN: llvm-objdump -d - | FileCheck %s
+
+.globl foo
+.type foo, @object
+foo:
+.ascii "this is a test"
+
+# CHECK: foo:
+# CHECK: 0:{{.*}}this is
+# CHECK: 8:{{.*}}a test
index a82ed0974fb746748fe124719b3ba1b405fc9e8d..735025bac63740a0ebebfaa845eed09a91f968ed 100644 (file)
@@ -1268,7 +1268,7 @@ static void disassembleObject(const Target *TheTarget, const ObjectFile *Obj,
               // Indent the space for less than 8 bytes data.
               // 2 spaces for byte and one for space between bytes
               IndentOffset = 3 * (8 - NumBytes);
-              for (int Excess = 8 - NumBytes; Excess < 8; Excess++)
+              for (int Excess = NumBytes; Excess < 8; Excess++)
                 AsciiData[Excess] = '\0';
               NumBytes = 8;
             }