[PATCH] D65799: [yaml2obj/obj2yaml][MachO] Allow setting custom section data

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 02:25:56 PDT 2019


jhenderson added inline comments.


================
Comment at: llvm/lib/ObjectYAML/MachOEmitter.cpp:322
+        } else {
+          // Fill section data with 0xDEADBEEF
+          Fill(OS, Sec.size, 0xDEADBEEFu);
----------------
Could you add the missing trailing full stop whilst you're here, please?


================
Comment at: llvm/test/ObjectYAML/MachO/section_data.yaml:44
+
+## Case 2: The content size content equals the section size.
+# RUN: yaml2obj --docnum=2 %s > %t2
----------------
Delete the second "content".


================
Comment at: llvm/tools/obj2yaml/macho2yaml.cpp:21
 
+static bool isVirtualSection(uint8_t type) {
+  return (type == MachO::S_ZEROFILL || type == MachO::S_GB_ZEROFILL ||
----------------
seiya wrote:
> I'd like to move this function into somewhere else instead of copying from MachOEmitter.cpp but I couldn't locate the appropriate place. Any suggestions?
Two suggestions:
1) MachOYAML.cpp/.h
2) BinaryFormat/MachO.h (assuming it could be useful in a wider context).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65799





More information about the llvm-commits mailing list