[lld-macho] Support .subsections_via_symbols
authorJez Ng <jezng@fb.com>
Mon, 11 May 2020 22:48:47 +0000 (15:48 -0700)
committerJez Ng <jezng@fb.com>
Tue, 19 May 2020 14:46:57 +0000 (07:46 -0700)
commite270b2f1727c0fbde2676e8d0340c0d934726d3c
treeb490500113a651b356111b4ae57860099f5de9e4
parent55e9eb416ee5af91d519a0b7d550c549f18257b0
[lld-macho] Support .subsections_via_symbols

This diff restores and builds upon @pcc and @ruiu's initial work on
subsections.

The .subsections_via_symbols directive indicates we can split each
section along symbol boundaries, unless those symbols have been marked
with `.alt_entry`.

We exercise this functionality in our tests by using order files that
rearrange those symbols.

Reviewed By: smeenai

Differential Revision: https://reviews.llvm.org/D79926
lld/MachO/Driver.cpp
lld/MachO/InputFiles.cpp
lld/MachO/InputFiles.h
lld/MachO/InputSection.cpp
lld/MachO/InputSection.h
lld/test/MachO/subsections-section-relocs.s [new file with mode: 0644]
lld/test/MachO/subsections-symbol-relocs.s [new file with mode: 0644]