HomePhabricator

[ELF] Align SHT_LLVM_PART_EHDR to a maximum page size boundary

Authored by MaskRay on Sep 2 2019, 1:49 AM.

Description

[ELF] Align SHT_LLVM_PART_EHDR to a maximum page size boundary

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=998712

SHT_LLVM_PART_EHDR marks the start of a partition. The partition
sections will be extracted to a separate file. Align to the next maximum
page size boundary so that we can find the ELF header at the start. We
cannot benefit from overlapping p_offset ranges with the previous
segment anyway.

It seems we lack some llvm-objcopy --extract-main-partition and
--extract-partition sanity checks. It may place EHDR at the start
even if p_offset if non zero. Anyway, the lld change is justified for
the reasons above.

Reviewed By: ruiu

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

llvm-svn: 370629

Details

Committed
MaskRaySep 2 2019, 1:49 AM
Reviewer
ruiu
Differential Revision
D67032: [ELF] Align SHT_LLVM_PART_EHDR to a maximum page size boundary
Parents
rG6897a814e66f: [lldb] Add description to option completions.
Branches
Unknown
Tags
Unknown