[all-commits] [llvm/llvm-project] 137a25: [llvm-readobj, libSupport] - Refine the implementa...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Wed Dec 2 02:55:56 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 137a25f04a515e5ea8f24c897e34b4cd236239a8
      https://github.com/llvm/llvm-project/commit/137a25f04a515e5ea8f24c897e34b4cd236239a8
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-12-02 (Wed, 02 Dec 2020)

  Changed paths:
    M llvm/lib/Support/ELFAttributeParser.cpp
    M llvm/test/tools/llvm-readobj/ELF/RISCV/attributes-invalid.test
    M llvm/tools/llvm-readobj/ELFDumper.cpp

  Log Message:
  -----------
  [llvm-readobj, libSupport] - Refine the implementation of the code that dumps build attributes.

This implementation of `ELFDumper<ELFT>::printAttributes()` in llvm-readobj has issues:
1) It crashes when the content of the attribute section is empty.
2) It uses `unwrapOrError` and `reportWarning` calls, though
   ideally we want to use `reportUniqueWarning`.
3) It contains a TODO about redundant format version check.

`lib/Support/ELFAttributeParser.cpp` uses a hardcoded constant instead of the named constant.

This patch fixes all these issues.

Differential revision: https://reviews.llvm.org/D92318




More information about the All-commits mailing list