[llvm] r352900 - [llvm-objdump] - llvm-objdump can skip bytes at the end of a section.
Sid Manning via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 1 11:11:47 PST 2019
Author: sidneym
Date: Fri Feb 1 11:11:47 2019
New Revision: 352900
URL: http://llvm.org/viewvc/llvm-project?rev=352900&view=rev
Log:
[llvm-objdump] - llvm-objdump can skip bytes at the end of a section.
Differential Revision: https://reviews.llvm.org/D57549
Added:
llvm/trunk/test/tools/llvm-objdump/X86/disasm-text.test
Modified:
llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
Added: llvm/trunk/test/tools/llvm-objdump/X86/disasm-text.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/disasm-text.test?rev=352900&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/disasm-text.test (added)
+++ llvm/trunk/test/tools/llvm-objdump/X86/disasm-text.test Fri Feb 1 11:11:47 2019
@@ -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
Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=352900&r1=352899&r2=352900&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Fri Feb 1 11:11:47 2019
@@ -1268,7 +1268,7 @@ static void disassembleObject(const Targ
// 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;
}
More information about the llvm-commits
mailing list