[lld-macho] Ensure that chained fixups data comes first in __LINKEDIT
authorDaniel Bertalan <dani@danielbertalan.dev>
Sat, 5 Nov 2022 15:29:11 +0000 (16:29 +0100)
committerDaniel Bertalan <dani@danielbertalan.dev>
Mon, 7 Nov 2022 22:51:24 +0000 (23:51 +0100)
commit79f9f1f8e33523ff64a34520f8a35dd819a74154
tree1a580a95fa1d63c3db2f2601969ac2547b0407b1
parent432a7e284440c719637fe34b972c96c9af0e01f1
[lld-macho] Ensure that chained fixups data comes first in __LINKEDIT

libstuff-based tools (e.g. `codesign` and `strip`) require
`__chainfixups` to be the first section in `__LINKEDIT`, and print a
"file not in an order that can be processed" error message if that is
not the case.

Differential Revision: https://reviews.llvm.org/D137492
lld/MachO/OutputSegment.cpp
lld/test/MachO/linkedit-contiguity.s