HomePhabricator

[llvm-readelf/obj] - Refine and generalize the code that is used to dump notes.

Authored by grimar on Thu, Sep 10, 5:26 AM.

Description

[llvm-readelf/obj] - Refine and generalize the code that is used to dump notes.

There is some code that can be shared between GNU/LLVM styles.
Also, this fixes 2 inconsistencies related to dumping unknown note types:

  1. For GNU style we printed "Unknown note type: (0x00000003)" in some cases, and "Unknown note type (0x00000003)" (no colon) in other cases. GNU readelf always prints :. This patch removes the related code duplication and does the same.
  2. For LLVM style in some cases we printed "Unknown note type (0x00000003)", but sometimes just "Unknown (0x00000003)". The latter is the right form, which is consistent with other unknowns that are printed in LLVM style.

Rebased on top of D87453.

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