[lld-macho] Support -order_file
authorJez Ng <jezng@fb.com>
Tue, 5 May 2020 23:37:34 +0000 (16:37 -0700)
committerJez Ng <jezng@fb.com>
Tue, 19 May 2020 14:46:57 +0000 (07:46 -0700)
commit55e9eb416ee5af91d519a0b7d550c549f18257b0
tree531f3d4bef26b2ed794048bc247c3fb211de7044
parentcff9399f6b90233a62eeb808277c98c615d44d8a
[lld-macho] Support -order_file

The order file indicates how input sections should be sorted within each
output section, based on the symbols contained within those sections.

This diff sets the stage for implementing and testing
`.subsections_via_symbols`, where we will break up InputSections by each
symbol and sort them more granularly.

Reviewed By: smeenai

Differential Revision: https://reviews.llvm.org/D79668
14 files changed:
lld/MachO/Config.h
lld/MachO/Driver.cpp
lld/MachO/InputFiles.cpp
lld/MachO/MergedOutputSection.h
lld/MachO/Options.td
lld/MachO/OutputSection.h
lld/MachO/OutputSegment.cpp
lld/MachO/OutputSegment.h
lld/MachO/SyntheticSections.cpp
lld/MachO/SyntheticSections.h
lld/MachO/Writer.cpp
lld/test/MachO/invalid/order-file-bad-arch.test [new file with mode: 0644]
lld/test/MachO/invalid/order-file-bad-objfile.test [new file with mode: 0644]
lld/test/MachO/order-file.s [new file with mode: 0644]