aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ObjectYAML
diff options
context:
space:
mode:
authorJake Ehrlich <jakehehrlich@google.com>2017-11-01 23:14:48 +0000
committerJake Ehrlich <jakehehrlich@google.com>2017-11-01 23:14:48 +0000
commit03aeeb09c53923072d561d004b6f682664a2eb8c (patch)
treeb6efdbb165c16a2fe809b522652d598707626e4c /llvm/lib/ObjectYAML
parentbfa77c4c85dbe28c8b651b6e692b7673c8cfb349 (diff)
downloadllvm-03aeeb09c53923072d561d004b6f682664a2eb8c.zip
llvm-03aeeb09c53923072d561d004b6f682664a2eb8c.tar.gz
llvm-03aeeb09c53923072d561d004b6f682664a2eb8c.tar.bz2
[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
Diffstat (limited to 'llvm/lib/ObjectYAML')
-rw-r--r--llvm/lib/ObjectYAML/ELFYAML.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/ELFYAML.cpp b/llvm/lib/ObjectYAML/ELFYAML.cpp
index b19a575..ada9ff8 100644
--- a/llvm/lib/ObjectYAML/ELFYAML.cpp
+++ b/llvm/lib/ObjectYAML/ELFYAML.cpp
@@ -719,6 +719,7 @@ void MappingTraits<ELFYAML::ProgramHeader>::mapping(
IO.mapOptional("Sections", Phdr.Sections);
IO.mapOptional("VAddr", Phdr.VAddr, Hex64(0));
IO.mapOptional("PAddr", Phdr.PAddr, Hex64(0));
+ IO.mapOptional("Align", Phdr.Align);
}
namespace {