summaryrefslogtreecommitdiff
path: root/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
commit9ae2da659ffdc34a54d8e67df7afcb509bdace17 (patch)
tree319aa8283dabd98a0b3026d828b5a4b2ce6376c9 /lib/ObjectYAML
parent368924ad91dfdd49a4b28251b47f9e723241ba92 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317139 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ObjectYAML')
-rw-r--r--lib/ObjectYAML/ELFYAML.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ObjectYAML/ELFYAML.cpp b/lib/ObjectYAML/ELFYAML.cpp
index b19a57585a3..ada9ff89b8e 100644
--- a/lib/ObjectYAML/ELFYAML.cpp
+++ b/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 {