]> granicus.if.org Git - llvm/commit
Add the error handling for Mach-O dyld compact lazy bind, weak bind and
authorKevin Enderby <enderby@apple.com>
Mon, 27 Mar 2017 20:09:23 +0000 (20:09 +0000)
committerKevin Enderby <enderby@apple.com>
Mon, 27 Mar 2017 20:09:23 +0000 (20:09 +0000)
commit3903b47a909d6ef870aa29146c119a42b67277c1
tree9813e31dddc6e72a092f0ba30e71ae6426784d19
parentfcdf36fabb6d38f3b22b3515f9ad271a8b085842
Add the error handling for Mach-O dyld compact lazy bind, weak bind and
rebase entry errors and test cases for each of the error checks.

Also verified with Nick Kledzik that a BIND_OPCODE_SET_ADDEND_SLEB
opcode is legal in a lazy bind table, so code that had that as an error
check was removed.

With MachORebaseEntry and MachOBindEntry classes now returning
an llvm::Error in all cases for malformed input the variables Malformed
and logic to set use them is no longer needed and has been removed
from those classes.

Also in a few places, removed the redundant Done assignment to true
when also calling moveToEnd() as it does that assignment.

This only leaves the dyld compact export entries left to have
error handling yet to be added for the dyld compact info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298883 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
include/llvm/Object/MachO.h
lib/Object/MachOObjectFile.cpp
test/tools/llvm-objdump/Inputs/macho-bind-missing-done [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-lazy-do-bind-add-addr-imm-scaled [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-lazy-do-bind-uleb-times-skipping-uleb [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-lazy-do_bind_add_addr_uleb [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-rebase-add-addr-imm-scaled [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-rebase-add-addr-uleb [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-rebase-add-addr-uleb-too-big [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-rebase-bad-opcode-value [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-rebase-imm-times [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-rebase-missing-done [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-rebase-seg-too-big [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-rebase-segoff-too-big [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-rebase-set-type-imm [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-rebase-uleb-malformed-uleb128 [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-rebase-uleb-times [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-rebase-uleb-times-skipping-uleb [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-weak-bind-set-dylib-ordinal-imm [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-weak-bind-set-dylib-ordinal-uleb [new file with mode: 0755]
test/tools/llvm-objdump/Inputs/macho-weak-bind-set-dylib-special-imm [new file with mode: 0755]
test/tools/llvm-objdump/macho-bad-bind.test