diff options
author | Juergen Ributzka <juergen@ributzka.de> | 2017-03-30 19:56:50 +0000 |
---|---|---|
committer | Juergen Ributzka <juergen@ributzka.de> | 2017-03-30 19:56:50 +0000 |
commit | cad124910683d12220eb3a137992317dc36bfd32 (patch) | |
tree | a86d87eb030079d616990d48520afb8d2e35bf41 /llvm/lib/Object/MachOObjectFile.cpp | |
parent | a0bd28c4d9c0c81005aebc16b11425395a617a9c (diff) | |
download | bcm5719-llvm-cad124910683d12220eb3a137992317dc36bfd32.tar.gz bcm5719-llvm-cad124910683d12220eb3a137992317dc36bfd32.zip |
[Object] Remove check for BIND_OPCODE_DONE/REBASE_OPCODE_DONE.
BIND_OPCODE_DONE/REBASE_OPCODE_DONE may appear at the end of the opcode array,
but they are not required to. The linker only adds them as padding to align the
opcodes to pointer size.
This fixes rdar://problem/31285560.
llvm-svn: 299104
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 8124c18f30e..f2c2aead5a9 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -2780,12 +2780,10 @@ void MachORebaseEntry::moveNext() { --RemainingLoopCount; return; } - if (Ptr >= Opcodes.end()) { - if (Opcodes.begin() != Opcodes.end() && Done != true) { - *E = malformedError("missing REBASE_OPCODE_DONE at end of opcodes"); - moveToEnd(); - return; - } + // REBASE_OPCODE_DONE is only used for padding if we are not aligned to + // pointer size. Therefore it is possible to reach the end without ever having + // seen REBASE_OPCODE_DONE. + if (Ptr == Opcodes.end()) { Done = true; return; } @@ -3164,12 +3162,10 @@ void MachOBindEntry::moveNext() { --RemainingLoopCount; return; } - if (Ptr >= Opcodes.end()) { - if (Opcodes.begin() != Opcodes.end() && Done != true) { - *E = malformedError("missing BIND_OPCODE_DONE at end of opcodes"); - moveToEnd(); - return; - } + // BIND_OPCODE_DONE is only used for padding if we are not aligned to + // pointer size. Therefore it is possible to reach the end without ever having + // seen BIND_OPCODE_DONE. + if (Ptr == Opcodes.end()) { Done = true; return; } |