[PATCH] D92644: [obj2yaml] - Support dumping objects that have multiple SHT_SYMTAB_SHNDX sections.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 7 02:00:35 PST 2020


jhenderson added a comment.

I actually filed a bug about this a while back: https://bugs.llvm.org/show_bug.cgi?id=43991



================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:318
+      if (Expected<ArrayRef<Elf_Word>> TableOrErr = Obj.getSHNDXTable(Sec)) {
+        const Elf_Shdr *LinkedSymTab = cantFail(Obj.getSection(Sec.sh_link));
+        if (!ShndxTables.insert({LinkedSymTab, *TableOrErr}).second)
----------------
It might be worth a comment why this is a `cantFail`, since it seems quite possible sh_link could be invalid.


================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:326
+      } else {
+        return createStringError(errc::not_supported,
+                                 "unable to read extended section indexes: " +
----------------
Is `not_supported` correct here? I'm asuming the error is when the data isn't a valid `getSHNDXTable` which sounds more like `parse_failed` or `illegal_argument`.


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

https://reviews.llvm.org/D92644



More information about the llvm-commits mailing list