[llvm-readobj] - Remove an excessive helper for printing dynamic tags.
authorGeorgii Rymar <grimar@accesssoftek.com>
Mon, 23 Dec 2019 11:54:36 +0000 (14:54 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Tue, 24 Dec 2019 08:55:45 +0000 (11:55 +0300)
commit301cb91428eed651eeb1c3c0f11eed2e4f78f5f0
tree7d162bf3f052049ffe03d5d3f39c0f5272a526e4
parentc6a5534ea4f8d0245880ae6444a973758e46826d
[llvm-readobj] - Remove an excessive helper for printing dynamic tags.

This removes the `getTypeString` from readeobj source because it
almost duplicates the existent method: `ELFFile<ELFT>::getDynamicTagAsString`.

Side effect: now it prints "<unknown:>0xHEXVALUE" instead of "(unknown)" for unknown values.
llvm-readelf before this patch printed:

```
0x0000000012345678 (unknown) 0x8765432187654321
0x000000006abcdef0 (unknown) 0x9988776655443322
0x0000000076543210 (unknown) 0x5555666677778888
```

and now it prints:

```
0x0000000012345678 (<unknown:>0x12345678) 0x8765432187654321
0x000000006abcdef0 (<unknown:>0x6abcdef0) 0x9988776655443322
0x0000000076543210 (<unknown:>0x76543210) 0x5555666677778888
```

GNU reaedlf prints different thing:

```
0x0000000012345678 (<unknown>: 12345678) 0x8765432187654321
0x000000006abcdef0 (Operating System specific: 6abcdef0) 0x9988776655443322
0x0000000076543210 (Processor Specific: 76543210) 0x5555666677778888
```

I am not sure we want to follow GNU here. Even if we do, it should be separate
patch probably. The new output looks better and closer to GNU anyways,
and the code is a bit simpler.

Differential revision: https://reviews.llvm.org/D71835
llvm/lib/Object/ELF.cpp
llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
llvm/tools/llvm-readobj/ELFDumper.cpp