[llvm-commits] [llvm] r172130 - in /llvm/trunk: test/Object/objdump-sectionheaders.test tools/llvm-objdump/llvm-objdump.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Thu Jan 10 14:40:50 PST 2013
Author: mspencer
Date: Thu Jan 10 16:40:50 2013
New Revision: 172130
URL: http://llvm.org/viewvc/llvm-project?rev=172130&view=rev
Log:
[llvm-objdump] Emit addresses with the correct number of leading 0's.
Modified:
llvm/trunk/test/Object/objdump-sectionheaders.test
llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
Modified: llvm/trunk/test/Object/objdump-sectionheaders.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/objdump-sectionheaders.test?rev=172130&r1=172129&r2=172130&view=diff
==============================================================================
--- llvm/trunk/test/Object/objdump-sectionheaders.test (original)
+++ llvm/trunk/test/Object/objdump-sectionheaders.test Thu Jan 10 16:40:50 2013
@@ -6,11 +6,11 @@
; CHECK: Sections:
; CHECK: Idx Name Size Address Type
-; CHECK: 0 000000000 00000000000000000
-; CHECK: 1 .text 000000026 00000000000000000 TEXT DATA
-; CHECK: 2 .rodata.str1.1 00000000d 00000000000000026 DATA
-; CHECK: 3 .note.GNU-stack 000000000 00000000000000033
-; CHECK: 4 .rela.text 000000048 00000000000000038
-; CHECK: 5 .symtab 0000000c0 00000000000000080
-; CHECK: 6 .strtab 000000033 00000000000000140
-; CHECK: 7 .shstrtab 00000004b 00000000000000173
+; CHECK: 0 00000000 0000000000000000
+; CHECK: 1 .text 00000026 0000000000000000 TEXT DATA
+; CHECK: 2 .rodata.str1.1 0000000d 0000000000000026 DATA
+; CHECK: 3 .note.GNU-stack 00000000 0000000000000033
+; CHECK: 4 .rela.text 00000048 0000000000000038
+; CHECK: 5 .symtab 000000c0 0000000000000080
+; CHECK: 6 .strtab 00000033 0000000000000140
+; CHECK: 7 .shstrtab 0000004b 0000000000000173
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=172130&r1=172129&r2=172130&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Thu Jan 10 16:40:50 2013
@@ -442,7 +442,7 @@
if (error(si->isBSS(BSS))) return;
std::string Type = (std::string(Text ? "TEXT " : "") +
(Data ? "DATA " : "") + (BSS ? "BSS" : ""));
- outs() << format("%3d %-13s %09" PRIx64 " %017" PRIx64 " %s\n",
+ outs() << format("%3d %-13s %08" PRIx64 " %016" PRIx64 " %s\n",
i, Name.str().c_str(), Size, Address, Type.c_str());
++i;
}
@@ -572,7 +572,10 @@
else if (Type == SymbolRef::ST_Function)
FileFunc = 'F';
- outs() << format("%08" PRIx64, Address) << " "
+ const char *Fmt = o->getBytesInAddress() > 4 ? "%016" PRIx64 :
+ "%08" PRIx64;
+
+ outs() << format(Fmt, Address) << " "
<< GlobLoc // Local -> 'l', Global -> 'g', Neither -> ' '
<< (Weak ? 'w' : ' ') // Weak?
<< ' ' // Constructor. Not supported yet.
More information about the llvm-commits
mailing list