[PATCH] D109803: Extract LC_CODE_SIGNATURE related implementation out of LLD
Vy Nguyen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 15 12:28:39 PDT 2021
oontvoo added inline comments.
================
Comment at: lld/MachO/SyntheticSections.cpp:1150
+ align = object::CodeSignatureSection::Align; // required by libstuff
// FIXME: Consider using finalOutput instead of outputFile.
}
----------------
this is now a stray comment?
================
Comment at: llvm/include/llvm/Object/MachO.h:737-750
+ // FileOff is the offset relative to the start of the file
+ // used to access the start of code signature section
+ // in __LINKEDIT segment
+ uint64_t FileOff;
+ StringRef OutputFileName;
+ MachO::HeaderFileType OutputFileType;
+ uint64_t TextSegmentFileOff;
----------------
Please consider re-arranging the members. I think the convention is to leave private fields at the end of the class, after private methods. (Also explicit modifier is preferred).
More generally, the order of members are `<PUBLIC>, <PROTECTED>, <PRIVATE>`, then within each, methods go before fields.
================
Comment at: llvm/lib/Object/CodeSignatureSection.cpp:27
+
+static_assert((CodeSignatureSection::BlobHeadersSize % 8) == 0, "");
+static_assert((CodeSignatureSection::FixedHeadersSize % 8) == 0, "");
----------------
not needed - unless you're going to add some text here?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109803/new/
https://reviews.llvm.org/D109803
More information about the llvm-commits
mailing list