[PATCH] D39130: [yaml2obj][ELF] Add support for setting alignment in program headers and fix default alignment

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 11:15:58 PDT 2017


jakehehrlich created this revision.

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. This change also fixes the default alignment in program headers to be the maximum of all sections in the segment.  I was confused about what the exact alignment constraint was on program headers and this caused me to argue that the incorrect default choice should be made for segment alignment (and also caused the bug in llvm-objcopy).


Repository:
  rL LLVM

https://reviews.llvm.org/D39130

Files:
  include/llvm/ObjectYAML/ELFYAML.h
  lib/ObjectYAML/ELFYAML.cpp
  test/tools/yaml2obj/program-header-align.yaml
  tools/yaml2obj/yaml2elf.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39130.119671.patch
Type: text/x-patch
Size: 3754 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171020/2abe41c7/attachment.bin>


More information about the llvm-commits mailing list