[llvm-objcopy][MachO] Fix segment size alignment
authorAlexander Shaposhnikov <alexshap@fb.com>
Tue, 30 Jun 2020 06:09:38 +0000 (23:09 -0700)
committerAlexander Shaposhnikov <alexshap@fb.com>
Tue, 30 Jun 2020 06:55:21 +0000 (23:55 -0700)
commit2c663aa539c3c378599776f4a6849f1cbee5fb93
treeed03fbd2eaaa6db593fc2abd6e23e38aaa8481e7
parent46a7f4d6f4bf2cc23a410e771adb587c5968047d
[llvm-objcopy][MachO] Fix segment size alignment

This diff addresses the old TODO in MachOObjcopy.cpp and
correctly sets the page size used for alignment of segments.
In particular, now llvm-objcopy's output is consistent
with the input (the alignment of vmsize doesn't change).

Test plan:

1. make check-all
2. verify that a binary copied via llvm-objcopy now correctly works on iOS.

Differential revision: https://reviews.llvm.org/D82503
llvm/test/tools/llvm-objcopy/MachO/segment-size-alignment.test [new file with mode: 0644]
llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp