[obj2yaml] - Teach tool to emit the "SectionHeaderTable" key and sort sections by...
authorGeorgii Rymar <grimar@accesssoftek.com>
Tue, 10 Nov 2020 13:33:57 +0000 (16:33 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Tue, 1 Dec 2020 09:59:15 +0000 (12:59 +0300)
commitea8c8a50976fd5b9ca9799414bd3c412fce37f03
tree1ec3b34a6752ea956bd3c80d336f69332ab377df
parent398b729243b12bdfbc7a75b46d39b547545cbd2d
[obj2yaml] - Teach tool to emit the "SectionHeaderTable" key and sort sections by file offset.

Currently when we dump sections, we dump them in the order,
which is specified in the sections header table.

With that the order in the output might not match the order in the file.
This patch starts sorting them by by file offsets when dumping.

When the order in the section header table doesn't match the order
in the file, we should emit the "SectionHeaderTable" key. This patch does it.

Differential revision: https://reviews.llvm.org/D91249
llvm/lib/ObjectYAML/ELFYAML.cpp
llvm/test/Object/X86/obj2yaml-dup-section-name.s
llvm/test/Object/obj2yaml.test
llvm/test/tools/obj2yaml/ELF/offset.yaml
llvm/tools/obj2yaml/elf2yaml.cpp