[PATCH] D113234: Extend obj2yaml to optionally preserve raw __LINKEDIT/__DATA segments.
    Adrian Prantl via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Nov  5 08:36:11 PDT 2021
    
    
  
aprantl added inline comments.
================
Comment at: llvm/lib/Object/MachOObjectFile.cpp:2052
+template <typename LoadCommandType>
+ArrayRef<uint8_t> getSegmentContents(const MachOObjectFile &Obj,
+                                     MachOObjectFile::LoadCommandInfo LoadCmd,
----------------
alexander-shaposhnikov wrote:
> static ?
Good point! My understanding is that a template cannot also be a static function, but I should at least put it into the anonymous namespace.
================
Comment at: llvm/tools/obj2yaml/macho2yaml.cpp:656
+Error macho2yaml(raw_ostream &Out, const object::Binary &Binary,
+                 bool RawDataSegment, bool RawLinkEditSegment) {
   if (const auto *MachOObj = dyn_cast<object::MachOUniversalBinary>(&Binary))
----------------
alexander-shaposhnikov wrote:
> in the future someone might want to dump other segments too, though I'm not sure what would be the best solution here 
These two are all I need right now, but if these options proliferate in the future, we should probably pass a list of raw segment names or an option struct.
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113234/new/
https://reviews.llvm.org/D113234
    
    
More information about the llvm-commits
mailing list