llvm-project/llvm/test/Object/macho-rebase-bind-trailing-opcode-boundary.test
Zixu Wang 1fa073ab89
[MachO] Stop parsing past end of rebase/bind table (#93897)
`MachORebaseEntry::moveNext()` and `MachOBindEntry::moveNext()` assume
that the rebase/bind table ends with `{REBASE|BIND}_OPCODE_DONE` or an
actual rebase/bind. However a valid rebase/bind table might also end
with other effectively no-op opcodes, which caused the parser to move
past the end and go into the next table, resulting in corrupted entries
or infinite loops.
2024-05-30 23:08:01 -07:00

17 lines
790 B
Plaintext

RUN: yaml2obj %p/Inputs/MachO/rebase-bind-table-trailing-opcode.yaml | \
RUN: llvm-objdump --rebase --bind --weak-bind --macho - | \
RUN: FileCheck %s
CHECK: Rebase table:
CHECK-NEXT: segment section address type
CHECK-NEXT: __DATA_CONST __got 0x00008000 pointer
CHECK-NEXT: __DATA __la_symbol_ptr 0x0000C000 pointer
CHECK: Bind table:
CHECK-NEXT: segment section address type addend dylib symbol
CHECK-NEXT: __DATA_CONST __got 0x00008008 pointer 0 libSystem dyld_stub_binder
CHECK: Weak bind table:
CHECK-NEXT: segment section address type addend symbol
CHECK-NEXT: __DATA_CONST __got 0x00008000 pointer 0 _foo