[PATCH] D75833: [RISCV] Support RISC-V ELF attribute section in llvm-readobj

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 01:03:54 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/RISCV/invalid-attr-version.test:1
+## This test case is used to ensure llvm-readobj checks the version of ELF
+## attribute section correctly.
----------------
Delete "ELF" - the test is in the ELF directory, so it's obvious that this is testing ELF.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/RISCV/invalid-attr-version.test:2
+## This test case is used to ensure llvm-readobj checks the version of ELF
+## attribute section correctly.
+
----------------
section -> sections


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:2726
     if (Contents[0] != ELFAttrs::Format_Version) {
-      errs() << "unrecognised FormatVersion: 0x"
-             << Twine::utohexstr(Contents[0]) << '\n';
+      reportError(createError(Twine("unrecognised FormatVersion: 0x") +
+                              Twine::utohexstr(Contents[0])),
----------------
Thinking about this, this should probably be `reportWarning`. In general, we don't want the tool to stop processing other options as soon as it sees something bad, as it might well be able to perform those options without any problems.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75833





More information about the llvm-commits mailing list