[PATCH] D104613: [llvm-readobj][XCOFF] Add support for printing the String Table.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 00:34:43 PDT 2021


jhenderson added a comment.

I just noticed that the code for `--string-dump` is generic, rather than ELF specific. It loops over the provided sections, and retrieves some details, but the main body of the loop should do exactly what you want to do. Perhaps it would be worth splitting out the `while` loop from `ObjDumper::printSectionsAsString` into a separate function and simply reusing that? This would ensure the XCOFF behaviour and other object behaviour is broadly equivalent.



================
Comment at: llvm/lib/Object/XCOFFObjectFile.cpp:192-193
+  MapVector<uint64_t, StringRef> StrTableMap;
+  if (StringTable.Data == nullptr)
+    return StrTableMap;
+  const char *StringTablePtr = StringTable.Data;
----------------
Is this an actual case that can happen? Under what circumstances? Perhaps those circumstances deserve a comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104613



More information about the llvm-commits mailing list