[PATCH] D111164: Regenerate LC_CODE_SIGNATURE during llvm-objcopy operations

Daniel Rodríguez Troitiño via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 7 09:21:57 PDT 2021


drodriguez added inline comments.


================
Comment at: llvm/tools/llvm-objcopy/MachO/Object.h:361
   LinkData FunctionStarts;
-  LinkData CodeSignature;
+  CodeSignatureInfo CodeSignature;
 
----------------
nuriamari wrote:
> alexander-shaposhnikov wrote:
> > maybe it'd be better to make it a part of MachOLayoutBuilder ?
> > (since it appears to be used only there)
> It is also used in the `MachOWriter`, but I suppose the `Writer` can reach into the `LayoutBuilder` for that information.
@alexander-shaposhnikov: Can we talk again about this? It feels as if the rest of the `LinkData` blobs have their information hold in this `Object` struct. Most of them are simply the data itself, but for other things, like `IndirectSymbolTable`, it seems that they are defined here, and used in the `MachOReader`, the `MachOLayoutBuilder` and the `MachOWriter`. In the case of the `LC_CODE_SIGNATURE`, we don't have any use in `MachOReader` because the information is discarded, but it seems to me that this is the correct place. Additionally, to be usage from `MachOWriter` and `MachOLayoutBuilder`, it needs to end up as a public instance variable in `MachOLayoutBuilder`, making it the first public instance variable of that class.

In any case, it is a minimal thing, and I don't need it to be changed. I just wanted to point out the similarities with the code here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111164/new/

https://reviews.llvm.org/D111164



More information about the llvm-commits mailing list