================ @@ -271,6 +283,131 @@ class ObjectFileMachO : public lldb_private::ObjectFile { uint32_t strsize = 0; /* string table size in bytes */ }; + // The LC_DYLD_INFO's dyld_info_command has 32-bit file offsets + // that we will use as virtual address offsets, and may need to span + // more than 4GB in virtual memory. + struct DyldInfoCommandLargeOffsets { + DyldInfoCommandLargeOffsets() {} + DyldInfoCommandLargeOffsets(const llvm::MachO::dyld_info_command &in) + : cmd(in.cmd), cmdsize(in.cmdsize), rebase_off(in.rebase_off), + rebase_size(in.rebase_size), bind_off(in.bind_off), + bind_size(in.bind_size), weak_bind_off(in.weak_bind_off), + weak_bind_size(in.weak_bind_size), lazy_bind_off(in.lazy_bind_off), + lazy_bind_size(in.lazy_bind_size), export_off(in.export_off), + export_size(in.export_size) {} + + void operator=(const llvm::MachO::dyld_info_command &in) { + cmd = in.cmd; + cmdsize = in.cmdsize; + rebase_off = in.rebase_off; + rebase_size = in.rebase_size; + bind_off = in.bind_off; + bind_size = in.bind_size; + weak_bind_off = in.weak_bind_off; + weak_bind_size = in.weak_bind_size; + lazy_bind_off = in.lazy_bind_off; + lazy_bind_size = in.lazy_bind_size; + export_off = in.export_off; + export_size = in.export_size; + }; + + uint32_t cmd = 0; /* LC_DYLD_INFO or LC_DYLD_INFO_ONLY */ + uint32_t cmdsize = 0; /* sizeof(struct dyld_info_command) */ + lldb::offset_t rebase_off = 0; /* file offset to rebase info */ + uint32_t rebase_size = 0; /* size of rebase info */ + lldb::offset_t bind_off = 0; /* file offset to binding info */ + uint32_t bind_size = 0; /* size of binding info */ + lldb::offset_t weak_bind_off = 0; /* file offset to weak binding info */ + uint32_t weak_bind_size = 0; /* size of weak binding info */ + lldb::offset_t lazy_bind_off = 0; /* file offset to lazy binding info */ + uint32_t lazy_bind_size = 0; /* size of lazy binding infs */ + lldb::offset_t export_off = 0; /* file offset to lazy binding info */ + uint32_t export_size = 0; /* size of lazy binding infs */ + }; + + // The LC_DYSYMTAB's dysymtab_command has 32-bit file offsets + // that we will use as virtual address offsets, and may need to span + // more than 4GB in virtual memory. ---------------- JDevlieghere wrote:
```suggestion /// The LC_DYSYMTAB's dysymtab_command has 32-bit file offsets /// that we will use as virtual address offsets, and may need to span /// more than 4GB in virtual memory. ``` https://github.com/llvm/llvm-project/pull/159849 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits