[Lldb-commits] [lldb] [lldb] Set default object format to `MachO` in `ObjectFileMachO` (PR #142704)

via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 4 11:09:41 PDT 2025


royitaqi wrote:

> > It's not clear if there are legitimate production use cases where the Mach-O files don't have said load commands. If there is, then what is their expected object format? Without this patch, they are currently ELF. With this patch, they will become MachO
> 
> At the point in the code where you made your change we already assume that we have a Mach-O file because we are passing in and examining the header. I think it makes sense to set the triple to be Mach-O here.
> 
> Even if we have Mach-O files in the wild that don't have the version load commands, it seems those still must be treated as Mach-O files to make any sense of them.

I agree. In a sense, this patch is fixing this bug for those Mach-O files.

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


More information about the lldb-commits mailing list