[yaml2obj] - Add a way to override the sh_addralign field of a section.
authorGeorgii Rymar <grimar@accesssoftek.com>
Fri, 23 Oct 2020 09:50:48 +0000 (12:50 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Tue, 27 Oct 2020 10:03:38 +0000 (13:03 +0300)
commit2d59ed4e62a9842be428f32976760dbb9cf336af
tree6baccce7ef81e1c546f7179e913d3f7d34bce783
parentf067bc3c0ad6b8800f63066d654ad15c3dd33fd1
[yaml2obj] - Add a way to override the sh_addralign field of a section.

Imagine the following declaration of a section:
```
Sections:
  - Name:         .dynsym
    Type:         SHT_DYNSYM
    AddressAlign: 0x1111111111111111
```

The aligment is large and yaml2obj reports an error currently:
"the desired output size is greater than permitted. Use the --max-size option to change the limit"

This patch implements the "ShAddrAlign" key, which is similar to other "Sh*" keys we have.
With it it is possible to override the `sh_addralign` field, ignoring the writing of alignment bytes.

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