This is another patch that originated from the full GSYM patch https://reviews.llvm.org/D53379.
This patch adds the llvm::gsym::Header class which appears at the start of a stand alone GSYM file, or in the first bytes of the GSYM data in a GSYM section within a file. Added encode and decode methods with full error handling and full tests.
Any reason you prefer isValid over operator bool?