================
@@ -1697,6 +1701,14 @@ void ObjectFileMachO::ProcessSegmentCommand(
// isn't stored in the abstracted Sections.
m_mach_sections.push_back(sect64);
+ // Make sure we can load dSYM files whose __DWARF sections exceed the 4GB
+ // barrier. llvm::MachO::section_64 have only 32 bit file offsets for the
+ // section contents.
+ const uint64_t section_file_offset = sect64.offset + section_offset_adjust;
+ // If this section overflows a 4GB barrier, then we need to adjust any
+ // subsequent the section offsets.
+ if (is_dsym && ((uint64_t)sect64.offset + sect64.size) >= UINT32_MAX)
+ section_offset_adjust += 0x100000000ull;
----------------
DataCorrupted wrote:
nit: `(1 << 32)` -> `(1 ULL << 32)`
clang is very likely to treat `1` as int
https://github.com/llvm/llvm-project/pull/164471
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits