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:
parent
0cf4656556
commit
945e587a20
5
test/tools/llvm-readobj/hexdump.test
Normal file
5
test/tools/llvm-readobj/hexdump.test
Normal 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
|
@ -117,7 +117,8 @@ void ObjDumper::printSectionAsHex(const object::ObjectFile *Obj,
|
|||||||
uint8_t i;
|
uint8_t i;
|
||||||
uint8_t k;
|
uint8_t k;
|
||||||
|
|
||||||
W.startLine() << format_hex(SecPtr - SecContent, 10);
|
W.startLine() << format_hex(Section.getAddress() + (SecPtr - SecContent),
|
||||||
|
10);
|
||||||
W.startLine() << ' ';
|
W.startLine() << ' ';
|
||||||
for (i = 0; TmpSecPtr < SecEnd && i < 4; ++i) {
|
for (i = 0; TmpSecPtr < SecEnd && i < 4; ++i) {
|
||||||
for (k = 0; TmpSecPtr < SecEnd && k < 4; k++, TmpSecPtr++) {
|
for (k = 0; TmpSecPtr < SecEnd && k < 4; k++, TmpSecPtr++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user