LLVM offers 2 useful YAML tools, yaml2obj and obj2yaml. The former one reads YAML files and emits object files, e.g., ELF, COFF and MachO. The latter one does the reverse, reads object files and emits YAML files. We use these tools to write unit tests for binary tools, e.g., llvm-objdump, llvm-nm, llvm-readelf, as YAML is easier to read and edit than raw assembly codes and pre-built binaries. More importantly, YAML keeps our tests code base maintainable. However, yaml2obj currently doesn’t support generating DWARF sections very well (we have to hardcode the Content field of DWARF sections and it is not intuitive). This project aims to add DWARF support for yaml2obj (ELF part), which will ease our pain crafting DWARF tests.


Xing GUO


  • James Henderson
  • Davide Italiano-1