[PATCH] D69895: [yaml2obj/obj2yaml] - Add support for SHT_LLVM_LINKER_OPTIONS sections.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 10:18:26 PST 2019


MaskRay added inline comments.


================
Comment at: llvm/lib/ObjectYAML/ELFYAML.cpp:1353-1354
+          dyn_cast<ELFYAML::LinkerOptionsSection>(Section.get())) {
+    if (!Sec->Options && !Sec->Content)
+      return "either \"Options\" or \"Content\" must be specified";
+    if (Sec->Options && Sec->Content)
----------------
jhenderson wrote:
> Hmm... I think it should be okay to not have to specify anything to create an empty such section (I'd actually support this for other sections too, thinking about it, where an empty section is legitimate).
Deleting the check here looks good to me.


================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:625
+
+  S->Options = std::vector<ELFYAML::LinkerOption>();
+  for (size_t I = 0; I != Strings.size(); I += 2)
----------------
`S->Options.emplace();`


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

https://reviews.llvm.org/D69895





More information about the llvm-commits mailing list