Fix two bugs in llvm-objdump’s printing of Objective-C meta data
authorKevin Enderby <enderby@apple.com>
Tue, 6 Oct 2015 22:27:08 +0000 (22:27 +0000)
committerKevin Enderby <enderby@apple.com>
Tue, 6 Oct 2015 22:27:08 +0000 (22:27 +0000)
commit23090caf75d15a712ee4415a241fcfd442b1d0ef
tree3277d1ae2d610727eabeb0d08da4298e1f82585f
parent3c050416f050ffd637777d94b9f1a51bbad28b41
Fix two bugs in llvm-objdump’s printing of Objective-C meta data
from malformed Mach-O files that caused crashes.

We recently got about 700 malformed Mach-O files which we have
been using the improve the robustness of tools that deal with reading
data from object files.  These resulted in about 20 small bug fixes to
the darwin based tools.

The goal here is to also improve the robustness of llvm-objdump and
this is the first two fixes.  In talking with Tim Northover the approach
we thought might be best is to:

1) Only include tests for the malformed Mach-O files that cause crashes
(not all 700+ tests).
2) The test should only contain the command line option that caused the
crash and not all the others that don’t matter.
3) There should be only one line for the FileCheck that is past the point
of the crash if possible and if possible indicates the malformation.

Again the goal is to fix crashes and not so much care about how the
printing of malformed data comes out.

Tim also suggested if we really wanted to add test cases for all 700+
malformed Mach-O files putting them in the regression tests might be
an option.  But many of these do not cause crashes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249479 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-objdump/Inputs/malformed-machos/mem-crup-0001.macho [new file with mode: 0644]
test/tools/llvm-objdump/Inputs/malformed-machos/mem-crup-0006.macho [new file with mode: 0644]
test/tools/llvm-objdump/malformed-machos.test [new file with mode: 0644]
tools/llvm-objdump/MachODump.cpp