Extract LC_CODE_SIGNATURE related implementation out of LLD
authorNuri Amari <nuriamari@fb.com>
Thu, 16 Sep 2021 23:00:26 +0000 (16:00 -0700)
committerDaniel Rodríguez Troitiño <danielrodriguez@fb.com>
Fri, 17 Sep 2021 00:43:39 +0000 (17:43 -0700)
commitcc8229603b67763e77a46894f88f7d3ddd04de34
tree19172accd137d5db6e22c7c9fd67d17194696aa2
parentf4092c769031f4dde5844ce57f1d47a7e7080311
Extract LC_CODE_SIGNATURE related implementation out of LLD

Move the functionality in lld that handles writing of the LC_CODE_SIGNATURE load command and associated data section to a central reusable location.

This change is in preparation for another change that modifies llvm-objcopy to reproduce the LC_CODE_SIGNATURE load command and corresponding
data section to maintain the validity of signed macho object files passed through llvm-objcopy.

Reviewed By: #lld-macho, int3, oontvoo

Differential Revision: https://reviews.llvm.org/D109803
lld/MachO/SyntheticSections.cpp
lld/MachO/SyntheticSections.h
llvm/include/llvm/Object/MachO.h
llvm/lib/Object/CMakeLists.txt
llvm/lib/Object/CodeSignatureSection.cpp [new file with mode: 0644]