Fix a bug in llvm-objdump printing of 32-bit addresses for -section in non i386 and...
authorKevin Enderby <enderby@apple.com>
Wed, 27 Apr 2016 22:36:18 +0000 (22:36 +0000)
committerKevin Enderby <enderby@apple.com>
Wed, 27 Apr 2016 22:36:18 +0000 (22:36 +0000)
rdar://25896202

llvm-svn: 267807

llvm/test/tools/llvm-objdump/Inputs/section.macho-armv7 [new file with mode: 0644]
llvm/test/tools/llvm-objdump/macho-sections.test
llvm/tools/llvm-objdump/MachODump.cpp

diff --git a/llvm/test/tools/llvm-objdump/Inputs/section.macho-armv7 b/llvm/test/tools/llvm-objdump/Inputs/section.macho-armv7
new file mode 100644 (file)
index 0000000..456cd3e
Binary files /dev/null and b/llvm/test/tools/llvm-objdump/Inputs/section.macho-armv7 differ
index 07c2b52..a7e2e81 100644 (file)
@@ -1,3 +1,7 @@
 # RUN: llvm-objdump -macho -section=__data %p/Inputs/bind2.macho-x86_64 | FileCheck %s
 
 # CHECK: bind2.macho-x86_64:
+
+# RUN: llvm-objdump -macho -section=__data %p/Inputs/section.macho-armv7 | FileCheck -check-prefix CHECK-ADDR %s
+
+#  CHECK-ADDR: 00000004        00000001
index cc67733..3d5c6ec 100644 (file)
@@ -1001,7 +1001,7 @@ static void DumpRawSectionContents(MachOObjectFile *O, const char *sect,
       if (O->is64Bit())
         outs() << format("%016" PRIx64, addr) << "\t";
       else
-        outs() << format("%08" PRIx64, sect) << "\t";
+        outs() << format("%08" PRIx64, addr) << "\t";
       for (j = 0; j < 4 * sizeof(int32_t) && i + j < size;
            j += sizeof(int32_t)) {
         if (i + j + sizeof(int32_t) < size) {