[yaml2obj] - Improve handling of SectionHeaderTable::NoHeaders flag.
authorGeorgii Rymar <grimar@accesssoftek.com>
Wed, 28 Oct 2020 10:34:28 +0000 (13:34 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Thu, 29 Oct 2020 09:16:52 +0000 (12:16 +0300)
commitfcf62879163ab28b4bd72cbc5715b49133f38427
treeadb4ba40bc248a3be98e504d74022779b641c1a7
parenta4b6b1e1c83fdfc5954e0fb631c2e6237236589e
[yaml2obj] - Improve handling of SectionHeaderTable::NoHeaders flag.

When `NoHeaders` is set, we still have following issues:
1) We emit the `.shstrtab` implicit section of size 1 (empty string table).
2) We still align the start of the section header table, what affects the output size.
3) We still write section header table bytes.

This patch fixes all of these issues.

Differential revision: https://reviews.llvm.org/D90295
llvm/lib/ObjectYAML/ELFEmitter.cpp
llvm/test/tools/llvm-readobj/ELF/malformed-pt-dynamic.test
llvm/test/tools/yaml2obj/ELF/section-headers.yaml