1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[llvm-readobj] Set correct offset when dumping hex section output.

Differential Revision: https://reviews.llvm.org/D56369

llvm-svn: 351356
This commit is contained in:
Sid Manning 2019-01-16 16:17:19 +00:00
parent 0cf4656556
commit 945e587a20
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,5 @@
// Check dumping of the hexadecimal bytes of a section.
RUN: llvm-readobj -x .text %p/../../Object/Inputs/hello-world.elf-x86-64 | FileCheck %s
CHECK: Hex dump of section '.text':
CHECK-NEXT: {{^}}0x00400460

View File

@ -117,7 +117,8 @@ void ObjDumper::printSectionAsHex(const object::ObjectFile *Obj,
uint8_t i;
uint8_t k;
W.startLine() << format_hex(SecPtr - SecContent, 10);
W.startLine() << format_hex(Section.getAddress() + (SecPtr - SecContent),
10);
W.startLine() << ' ';
for (i = 0; TmpSecPtr < SecEnd && i < 4; ++i) {
for (k = 0; TmpSecPtr < SecEnd && k < 4; k++, TmpSecPtr++) {