[yaml2obj][ELF] Add support for setting alignment in program headers
authorJake Ehrlich <jakehehrlich@google.com>
Wed, 1 Nov 2017 23:14:48 +0000 (23:14 +0000)
committerJake Ehrlich <jakehehrlich@google.com>
Wed, 1 Nov 2017 23:14:48 +0000 (23:14 +0000)
commit03aeeb09c53923072d561d004b6f682664a2eb8c
treeb6efdbb165c16a2fe809b522652d598707626e4c
parentbfa77c4c85dbe28c8b651b6e692b7673c8cfb349
[yaml2obj][ELF] Add support for setting alignment in program headers

Sometimes program headers have larger alignments than any of the
sections they contain. Currently yaml2obj can't produce such files. A
bug recently appeared in llvm-objcopy that failed in such a case. I'd
like to be able to add tests to llvm-objcopy for such cases.

This change adds an optional alignment parameter to program headers that
will be used instead of calculating the alignment.

Differential Revision: https://reviews.llvm.org/D39130

llvm-svn: 317139
llvm/include/llvm/ObjectYAML/ELFYAML.h
llvm/lib/ObjectYAML/ELFYAML.cpp
llvm/test/tools/yaml2obj/program-header-align.yaml [new file with mode: 0644]
llvm/tools/yaml2obj/yaml2elf.cpp