[PATCH] D98003: [obj2yaml][XCOFF] Dump sections

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 00:33:23 PDT 2021


jhenderson added a comment.

You still need testing for your error cases, i.e. showing that obj2yaml produces a suitable error (or possibly follows some fallback path) when it encounters invalid content.



================
Comment at: llvm/test/tools/obj2yaml/XCOFF/aix.yaml:62-71
+  MagicNumber:     0x1DF
+Sections:
+  - Name:            .text
+    Flags:           [ STYP_TEXT ]
+    SectionData:     '00007400'
+    Relocations:
+      - Address:         0xE
----------------
Here and below, we usually remove excessive spacing, so that the values neatly line up, as close as possible to the tags. See the suggested edit for an example of what I mean.


================
Comment at: llvm/tools/obj2yaml/xcoff2yaml.cpp:60
+  if (Obj.is64Bit())
+    return createStringError(object_error::invalid_file_type,
+                             "64-bit XCOFF not supported yet");
----------------
Probably, this should just be `errc::not_implemented` (or something along those lines) - the file type is valid, we just haven't added support yet.

Is there much difference between 64 and 32-bit sections though, or could you just remove this error entirely and do the right thing?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98003



More information about the llvm-commits mailing list