summaryrefslogtreecommitdiffstats
path: root/llvm/tools/macho-dump/macho-dump.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2013-06-06 17:20:50 +0000
committerKevin Enderby <enderby@apple.com>2013-06-06 17:20:50 +0000
commit273ae01b035339a8fc52002d65cab5b836d08417 (patch)
treef2724c468a5e3816479f1f267ca3f61f0cbceba8 /llvm/tools/macho-dump/macho-dump.cpp
parent654649dd0bec9f20a8df1643f3adb391657b2e45 (diff)
downloadbcm5719-llvm-273ae01b035339a8fc52002d65cab5b836d08417.tar.gz
bcm5719-llvm-273ae01b035339a8fc52002d65cab5b836d08417.zip
Teach llvm-objdump with the -macho parser how to use the data in code table
from the LC_DATA_IN_CODE load command. And when disassembling print the data in code formatted for the kind of data it and not disassemble those bytes. I added the format specific functionality to the derived class MachOObjectFile since these tables only appears in Mach-O object files. This is my first attempt to modify the libObject stuff so if folks have better suggestions how to fit this in or suggestions on the implementation please let me know. rdar://11791371 llvm-svn: 183424
Diffstat (limited to 'llvm/tools/macho-dump/macho-dump.cpp')
-rw-r--r--llvm/tools/macho-dump/macho-dump.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/macho-dump/macho-dump.cpp b/llvm/tools/macho-dump/macho-dump.cpp
index 88fd4529ab4..897a785f41b 100644
--- a/llvm/tools/macho-dump/macho-dump.cpp
+++ b/llvm/tools/macho-dump/macho-dump.cpp
@@ -292,7 +292,7 @@ DumpDataInCodeDataCommand(const MachOObjectFile &Obj,
<< " ('datasize', " << LLC.DataSize << ")\n"
<< " ('_data_regions', [\n";
- unsigned NumRegions = LLC.DataSize / 8;
+ unsigned NumRegions = LLC.DataSize / sizeof(macho::DataInCodeTableEntry);
for (unsigned i = 0; i < NumRegions; ++i) {
macho::DataInCodeTableEntry DICE =
Obj.getDataInCodeTableEntry(LLC.DataOffset, i);
OpenPOWER on IntegriCloud