[PATCH] D50761: [yaml2obj] - Teach tool to produce SHT_GROUP section with a custom type.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 15 03:53:57 PDT 2018


jhenderson added a comment.

Is it normal for yaml2obj to only parse hex values and not decimal for other fields?



================
Comment at: test/tools/yaml2obj/elf-comdat-broken.yaml:30
+# CHECK-NEXT:     Signature: foo
+# CHECK-NEXT:     Section(s) in group [
+# CHECK-NEXT:     ]
----------------
Maybe it's worth having two invalid values, so that the second one is interpreted as a section index? What do you think?


================
Comment at: tools/yaml2obj/yaml2elf.cpp:541
     else if (SN2I.lookup(member.sectionNameOrType, sectionIndex)) {
-      WithColor::error() << "Unknown section referenced: '"
-                         << member.sectionNameOrType << "' at YAML section' "
-                         << Section.Name << "\n";
-      return false;
+      // We did not find the section and about to report an error.
+      // As a last resort - try to parse hex value as section index.
----------------
Nit: and about -> and are about
resort - try to parse hex value as section index. -> resort, try to parse as a hex value.


https://reviews.llvm.org/D50761





More information about the llvm-commits mailing list