Tools such as llvm-objdump or llvm-readobj support indirect symbol
tables. Here, support it for obj2yaml and yaml2obj.
If I am not wrong, llvm::yaml::Hex32 should have the same size as an uint32_t. In any case, it might be better to use a sizeof(llvm::yaml::Hex32::BaseType) or similar instead of a naked 4 in here.
A few nits, but mostly looks good.
Shouldn't need the explicit llvm prefix, since you're already in the llvm namespace.
UpperCamelCase for variable names.
Also, I'd not use auto here: the type isn't obvious from the RHS (although if you're keen on following existing style in this immediate area, I can live with it).
Is this the minimum this document can be reduced to? There's a lot of stuff that has no value to the test, although I know that Mach-O yaml2obj's side doesn't allow much to be removed to minimise noise.
Updated. Most of the LinkEditData could be removed (except the one under test), but the FileHeader and LoadCommands are required in order to not break the continuity of the binary.