Add a test to ensure that MachO files including
a LC_CODE_SIGNATURE load command produced by lld
are signed correctly.
Details
- Reviewers
gkm int3 drodriguez thakis - Group Reviewers
Restricted Project - Commits
- rGaaf00f3f19c1: Add MachO signature verification test
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lld/test/MachO/Inputs/code-signature-check.py | ||
---|---|---|
11 | can we have a docstring describing what this script does? |
lld/test/MachO/Inputs/code-signature-check.py | ||
---|---|---|
11 | +1 - Usage of the script would also be nice for future reader. |
lld/test/MachO/adhoc-codesign-hash.s | ||
---|---|---|
17 | nit: try to vertically align where possible (same for lines below) |
lld/test/MachO/Inputs/code-signature-check.py | ||
---|---|---|
2 | Any chance this could be omitted for portability? (since you've already invoked the script with %python below)? | |
lld/test/MachO/adhoc-codesign-hash.s | ||
17–34 | Perhaps consider using variables here to avoid duplication? (also easier for future updates?) (suggested diff is in-complete -- only included one eg) |
lld/test/MachO/Inputs/code-signature-check.py | ||
---|---|---|
2 | I'll remove the shebang, but the script does require at least python3.5 for the typing module. | |
lld/test/MachO/adhoc-codesign-hash.s | ||
17–34 | I haven't been able to get what you are suggesting working. Are FileCheck capture variables usable within a run command? |
lgtm
lld/test/MachO/adhoc-codesign-hash.s | ||
---|---|---|
17–34 | What @oontvoo left out was how to define variables for FileCheck :) you'll want something like -D#DATAOFF=16400 here for the substitution to work. Then you can reference it via [[#DATAOFF]]. (The # indicates that the value is an integer. It only matters if you want to do arithmetic on the values, which doesn't apply in this case, but it's nice to use # anyway for clarity.) |
Ah, yes - I'd forgot that part. Thanks for clarifying it!
not sure why this comment is not in-lined anymore. 🤔 @nuriamari : Do you use arc to update this patch?
Yes, I am using arc to update the patch, I did notice inline comments from previous revisions disappear, but if you change the diff viewer to show the first revision, the inline comments remain. In any case, I will add the variables to the FileCheck lines. Thanks!
Any chance this could be omitted for portability? (since you've already invoked the script with %python below)?
(also is python3 a must?)