[DWARFYAML] Make the debug_str section optional.
authorXing GUO <higuoxing@gmail.com>
Tue, 1 Sep 2020 01:57:03 +0000 (09:57 +0800)
committerXing GUO <higuoxing@gmail.com>
Tue, 1 Sep 2020 02:02:09 +0000 (10:02 +0800)
commit428b2ffad4a346a967a4a105356fbc0fa518e2cc
treee5f0122e2fceeacefde3a95dad480a1fd16c0530
parent1d3d9b9cd808ef37f3dacd3ada81bff1353cd24b
[DWARFYAML] Make the debug_str section optional.

This patch makes the debug_str section optional. When the debug_str
section exists but doesn't contain anything, yaml2obj will emit a
section header for it.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D86860
llvm/include/llvm/ObjectYAML/DWARFYAML.h
llvm/lib/ObjectYAML/DWARFEmitter.cpp
llvm/lib/ObjectYAML/DWARFYAML.cpp
llvm/test/ObjectYAML/MachO/DWARF-debug_str.yaml
llvm/test/tools/yaml2obj/ELF/DWARF/debug-str.yaml
llvm/tools/obj2yaml/dwarf2yaml.cpp