[llvm] Fix getting section info in large mach-o files. (PR #165940)

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 3 15:00:48 PST 2025


clayborg wrote:

> > Thanks for fixing! Can we add a test?
> 
> Just tested locally, some 8GB dSYM was consumed successfully by llvm-dwarfdump and gsymutil. I don't have any out-of-order larger-than-4GB dSYM to test the error handling, and I think that's fairly rare case. In terms of checking a test file into the git, I think our experience in lldb (#164471) told us that its just hard to do.

We definitely can't commit a huge binary, and obj2yaml amd yaml2obj won't create invalid object files (where the segments would have the numbers for us that we need without having the file data), nor do we want them to emit 4 to 8 GB binaries to disk just so we can test them. I also didn't see a Test.cpp variant for llvm/lib/Object/MachOObjectFile.cpp anywhere. Also if you create a mach-o file with just some LC_SEGMENT_64 load commands, but the data for the file isn't in the file, it will not load and emit an error I believe. So this is hard to test. I am open to ideas if anyone has any, but I can't find any acceptable solutions.


https://github.com/llvm/llvm-project/pull/165940


More information about the llvm-commits mailing list