@thakis pointed out that mach_header and mach_header_64
actually have the same set of (used) fields, with the 64-bit version
having extra padding. So we can access the fields we need using the
single mach_header type instead of using templates to switch between
the two.
I also spotted a potential issue where hasObjCSection tries to parse a
file w/o checking if it does indeed match the target arch... As such,
I've added a quick magic number check to ensure we don't access invalid
memory during findCommand().
Addresses PR50180.
clang-tidy: warning: 'auto *hdr' can be declared as 'const auto *hdr' [llvm-qualified-auto]
not useful