This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Support LC_ENCRYPTION_INFO
ClosedPublic

Authored by int3 on Apr 21 2021, 9:57 AM.

Details

Reviewers
thakis
Group Reviewers
Restricted Project
Commits
rGab9c21bbab38: [lld-macho] Support LC_ENCRYPTION_INFO
Summary

This load command records a range spanning from the end of the load
commands to the end of the __TEXT segment. Presumably the kernel will encrypt
all this data.

Diff Detail

Event Timeline

int3 created this revision.Apr 21 2021, 9:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2021, 9:57 AM
Herald added a subscriber: dang. · View Herald Transcript
int3 requested review of this revision.Apr 21 2021, 9:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2021, 9:57 AM
thakis accepted this revision.Apr 21 2021, 10:13 AM
thakis added a subscriber: thakis.

nice!

lld/MachO/Driver.cpp
968–972

use hasFlag. Does an explicit -encryptable enable this with ld64 when targeting macOS, or does ld64 diag then?

This revision is now accepted and ready to land.Apr 21 2021, 10:13 AM
int3 added inline comments.Apr 21 2021, 10:27 AM
lld/MachO/Driver.cpp
968–972

yeah, ld64 happily emits the load command for macOS when passed -encryptable

int3 updated this revision to Diff 339312.Apr 21 2021, 10:33 AM
int3 marked an inline comment as done.

hasFlag

This revision was landed with ongoing or failed builds.Apr 21 2021, 10:41 AM
This revision was automatically updated to reflect the committed changes.

Test fails for me with:

/Users/thakis/src/llvm-project/out/gn/bin/llvm-mc: error: : error: unable to get target for 'arm64_32-apple-watchos', see --version and --triple.

I only enable the x86 target in llvm. Either needs a REQUIRES: aarch64 or the arm bits should be in their own file or something.

Test fails for me with:

/Users/thakis/src/llvm-project/out/gn/bin/llvm-mc: error: : error: unable to get target for 'arm64_32-apple-watchos', see --version and --triple.

I only enable the x86 target in llvm. Either needs a REQUIRES: aarch64 or the arm bits should be in their own file or something.

I added the REQUIRES in b309f17abf1. LMK if you'd rather split the test instead.

int3 added a comment.Apr 21 2021, 12:41 PM

Oh yeah I forgot about the REQUIRES. Thanks for the fix!