mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
[llvm-objdump] Fix mach-o binding decompression error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220119 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2402e6315d
commit
50ede1623d
@ -1974,20 +1974,20 @@ void MachOBindEntry::moveNext() {
|
||||
SegmentOffset) << "\n");
|
||||
return;
|
||||
case MachO::BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB:
|
||||
AdvanceAmount = readULEB128();
|
||||
AdvanceAmount = readULEB128() + PointerSize;
|
||||
RemainingLoopCount = 0;
|
||||
if (TableKind == Kind::Lazy)
|
||||
Malformed = true;
|
||||
DEBUG_WITH_TYPE(
|
||||
"mach-o-bind",
|
||||
llvm::dbgs() << "BIND_OPCODE_DO_BIND_IMM_TIMES: "
|
||||
llvm::dbgs() << "BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB: "
|
||||
<< format("SegmentOffset=0x%06X", SegmentOffset)
|
||||
<< ", AdvanceAmount=" << AdvanceAmount
|
||||
<< ", RemainingLoopCount=" << RemainingLoopCount
|
||||
<< "\n");
|
||||
return;
|
||||
case MachO::BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED:
|
||||
AdvanceAmount = ImmValue * PointerSize;
|
||||
AdvanceAmount = ImmValue * PointerSize + PointerSize;
|
||||
RemainingLoopCount = 0;
|
||||
if (TableKind == Kind::Lazy)
|
||||
Malformed = true;
|
||||
|
BIN
test/tools/llvm-objdump/Inputs/bind2.macho-x86_64
Executable file
BIN
test/tools/llvm-objdump/Inputs/bind2.macho-x86_64
Executable file
Binary file not shown.
5
test/tools/llvm-objdump/macho-bind2.test
Normal file
5
test/tools/llvm-objdump/macho-bind2.test
Normal file
@ -0,0 +1,5 @@
|
||||
# RUN: llvm-objdump -macho -bind %p/Inputs/bind2.macho-x86_64 | FileCheck %s
|
||||
|
||||
# CHECK: __DATA __data 0x00001008 pointer 0 libSystem _malloc
|
||||
# CHECK: __DATA __data 0x00001050 pointer 0 libSystem _malloc
|
||||
# CHECK: __DATA __data 0x00001458 pointer 0 libSystem _malloc
|
Loading…
Reference in New Issue
Block a user