summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorJez Ng <jezng@fb.com>2020-04-27 12:50:59 -0700
committerShoaib Meenai <smeenai@fb.com>2020-04-27 12:58:12 -0700
commit6f63216c3d6450c885e40b6a67e46563ce3d9746 (patch)
tree2cdc9c924e8b257a1535bdd8307e86a78fe40862 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent64d44ae7c2de8c42058cf14d6decc7f5c3db5ebf (diff)
[lld-macho] Extend SyntheticSections to cover all segment load commands
Previously, the special segments `__PAGEZERO` and `__LINKEDIT` were implemented as special LoadCommands. This diff implements them using special sections instead which have an `isHidden()` attribute. We do not emit section headers for hidden sections, but we use their addresses and file offsets to determine that of their containing segments. In addition to allowing us to share more segment-related code, this refactor is also important for the next step of emitting dylibs: 1) dylibs don't have segments like __PAGEZERO, so we need an easy way of omitting them w/o messing up segment indices 2) Unlike the kernel, which is happy to run an executable with out-of-order segments, dyld requires dylibs to have their segment load commands arranged in increasing address order. The refactor makes it easier to implement sorting of sections and segments. Differential Revision: https://reviews.llvm.org/D76839
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions