diff options
author | Georgii Rymar <grimar@accesssoftek.com> | 2020-07-28 12:53:06 +0300 |
---|---|---|
committer | Georgii Rymar <grimar@accesssoftek.com> | 2020-07-28 16:16:42 +0300 |
commit | bd93f5ce07ef2fb9c1897bddc576fe4afb464788 (patch) | |
tree | a2c159bd918c51490c43123ec7cc6dc2f4c72ee1 /llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp | |
parent | 9b4826d18b5fba5fe638e1045c9c47d3fe8da8c8 (diff) | |
download | llvm-bd93f5ce07ef2fb9c1897bddc576fe4afb464788.zip llvm-bd93f5ce07ef2fb9c1897bddc576fe4afb464788.tar.gz llvm-bd93f5ce07ef2fb9c1897bddc576fe4afb464788.tar.bz2 |
[yaml2obj] - Add a way to override sh_type section field.
This adds the `ShType` key similar to others `Sh*` keys we have.
My use case is the following. Imagine we have a `SHT_SYMTAB_SHNDX`
section and want to hide it from a dumper. The natural way would be to
do something like:
```
- Name: .symtab_shndx
Type: [[TYPE=SHT_SYMTAB_SHNDX]]
Entries: [ 0, 1 ]
```
and then change the TYPE from `SHT_SYMTAB_SHNDX` to something else,
for example to `SHT_PROGBITS`.
But we have a problem: regular sections does not have `Entries` key,
so yaml2obj will be unable to produce a section.
The solution is to introduce a `ShType` key to override the final type.
This is not the first time I am facing the need to change the type. I
was able to invent workarounds or solved issues differently in the past,
but finally came to conclusion that we just should support the `ShType`.
Differential revision: https://reviews.llvm.org/D84738
Diffstat (limited to 'llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp')
0 files changed, 0 insertions, 0 deletions