Skip to content

Commit

Permalink
[llvm-objdump] - llvm-objdump can skip bytes at the end of a section.
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D57549

llvm-svn: 352900
  • Loading branch information
Sid Manning committed Feb 1, 2019
1 parent 7ba2d3e commit 5d9c8ad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions llvm/test/tools/llvm-objdump/X86/disasm-text.test
@@ -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
2 changes: 1 addition & 1 deletion llvm/tools/llvm-objdump/llvm-objdump.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5d9c8ad

Please sign in to comment.