From a8d256cb366d3a9d368e3bf962bab1e37b7f100c Mon Sep 17 00:00:00 2001 From: Kevin Enderby Date: Mon, 20 Mar 2017 19:46:55 +0000 Subject: Add the rest of the error checking for Mach-O dyld compact bind entry errors and test cases for each of the error checks. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To do this more plumbing was needed so that the segment indexes and segment offsets can be checked. Basically what was done was the SegInfo from llvm-objdump’s MachODump.cpp was moved into libObject for Mach-O objects as BindRebaseSegInfo and it is only created when an iterator for bind or rebase entries are created. This commit really only adds the error checking and test cases for the bind table entires and the checking for the lazy bind and weak bind entries are still to be fully done as well as the rebase entires. Though some of the plumbing for those are added with this commit. Those other error checks and test cases will be added in follow on commits. Note, the two llvm_unreachable() calls should now actually be unreachable with the error checks in place and would take a logic bug in the error checking code to be reached if the segment indexes and segment offsets are used from a checked bind entry. Comments have been added to the methods that require the arguments to have been checked prior to calling. llvm-svn: 298292 --- .../llvm-objdump/Inputs/macho-do-bind-no-dylib-ordinal | Bin 0 -> 8456 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100755 llvm/test/tools/llvm-objdump/Inputs/macho-do-bind-no-dylib-ordinal (limited to 'llvm/test/tools/llvm-objdump/Inputs/macho-do-bind-no-dylib-ordinal') diff --git a/llvm/test/tools/llvm-objdump/Inputs/macho-do-bind-no-dylib-ordinal b/llvm/test/tools/llvm-objdump/Inputs/macho-do-bind-no-dylib-ordinal new file mode 100755 index 00000000000..77daede7868 Binary files /dev/null and b/llvm/test/tools/llvm-objdump/Inputs/macho-do-bind-no-dylib-ordinal differ -- cgit v1.2.3