[PATCH] D63084: [llvm-readobj] Don't abort printing of dynamic table if string reference is invalid

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 11:29:44 PDT 2019


ychen marked 3 inline comments as done.
ychen added inline comments.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:1942
+    OS << TagNames.at(Type) << ": ";
+    if (DynamicStringTable.size() == 0)
+      OS << "<String table is empty or was not found> ";
----------------
MaskRay wrote:
> DynamicStringTable.empty()
done


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:1947
+    else
+      OS << "<Invalid Offset 0x" << utohexstr(Value) << ">";
     break;
----------------
MaskRay wrote:
> `O->o` i.e. `<Invalid offset 0x`?
> 
> Alternatively, make it all lowercase: `<invalid offset 0x`. I'm just not sure which style is more common in this file.
done


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:1998
+      else
+        Libs.push_back("<library name not found>");
+    }
----------------
jhenderson wrote:
> MaskRay wrote:
> > I think `not found` is not entirely accurate. The issue is that the index into the string table is invalid (out of range). Do other reviewers have suggestion for the message used here?
> You're probably right. It should probably be something like `<library name index out of range>` or `<library name index invalid>` like you suggest.
Went with <Library name index out of range>


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63084





More information about the llvm-commits mailing list