[PATCH] D71835: [llvm-readobj] - Remove an excessive helper for printing dynamic tags.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 23 05:25:54 PST 2019


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay.
Herald added subscribers: rupprecht, hiraditya, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
grimar updated this revision to Diff 235130.
grimar added a comment.

- Removed a piece of code that belongs to a different change.


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.


https://reviews.llvm.org/D71835

Files:
  llvm/lib/Object/ELF.cpp
  llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
  llvm/tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71835.235130.patch
Type: text/x-patch
Size: 15614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191223/30df4982/attachment.bin>


More information about the llvm-commits mailing list