Have you rebased recently? I feel like the content in yaml2macho.cpp may have moved to the ObjectYAML library recently.
A 32-bit Offset but 64-bit Size seems off to me. What are the limitations on the two fields in Mach-O's file format?
Probably worth a header comment summarizing the purpose of the test, e.g. "Show that yaml2obj supports custom section data for Mach-O YAML inputs."
Nit: add a blank line before the YAML.
Move the check before the yaml. Flow should be:
## Comment # RUN: # CHECK: Yaml ## Comment # RUN: # CHECK: Yaml
The size of content -> The content size
equals to -> equals
size of content -> content size
are filled -> is filled
Why are these no longer CHECK-NEXT? Should you be testing the new stuff before it?
This comes from the definition of struct section_64 .
I removed the -NEXT because the newly added content fields were lengthy but it was bad idea. I've replaced them with regular expressions instead.
I'd like to move this function into somewhere else instead of copying from MachOEmitter.cpp but I couldn't locate the appropriate place. Any suggestions?
khm, to be honest, I would not place it here , these template specializations provide the static method "mapping" only. Somehow, I don't see where this method ("validate") is being used at the moment - maybe we can either delete it or hide it inside MachOYAML.cpp
Could you add the missing trailing full stop whilst you're here, please?
Delete the second "content".
validate is an optional method in MappingTraits and it's implemented in MachOYAML.cpp.
I think this should be here to validate obviously invalid input by YAMLTraits.h since it provides human-friendly error messages like:
YAML:30:9: error: Section size must be greater than or equal to the content size - sectname: __data ^ yaml2obj: error: Failed to parse YAML input!
Moved into the BinaryFormat/MachO.h. Thanks!