[yaml2obj] - Add a way to override sh_flags section field.
authorGeorgii Rymar <grimar@accesssoftek.com>
Thu, 12 Dec 2019 12:47:29 +0000 (15:47 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Fri, 13 Dec 2019 08:54:37 +0000 (11:54 +0300)
commit86e652f8284d44c0e3fa9b27421a671e89bfe0a0
tree246a8e5190e435b2b2ae46143cb18588954c8620
parent422b078c69ee7ae5c2529992eed4fd8a21aedda4
[yaml2obj] - Add a way to override sh_flags section field.

Currently we have the `Flags` property that allows to
set flags for a section. The problem is that it does not
allow us to set an arbitrary value, because of bit fields
validation under the hood. An arbitrary values can be used
to test specific broken cases.

We probably do not want to relax the validation, so this
patch adds a `ShSize` property that allows to
override the `sh_size`. It is inline with others `Sh*` properties
we have already.

Differential revision: https://reviews.llvm.org/D71411
llvm/include/llvm/ObjectYAML/ELFYAML.h
llvm/lib/ObjectYAML/ELFEmitter.cpp
llvm/lib/ObjectYAML/ELFYAML.cpp
llvm/test/tools/yaml2obj/ELF/override-shflags.yaml [new file with mode: 0644]