This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] - Teach readobj to print DT_FILTER dynamic tag in human readable form.
ClosedPublic

Authored by grimar on Jul 13 2017, 4:50 AM.

Details

Summary

Nothing special here,
output format is similar to the format used by binutils readelf and ELF Tool Chain readelf.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Jul 13 2017, 4:50 AM
emaste added a subscriber: emaste.Jul 13 2017, 6:43 AM

Should we instead switch DT_NEEDED to be like DT_AUXILIARY? This would be similar to the format used by binutils readelf and ELF Tool Chain readelf.

ELF Tool Chain:

Dynamic section at offset 0xd30 contains 25 entries:
  Tag                Type                  Name/Value
 0x0000000000000001 NEEDED               Shared library: [libc.so.7]
 0x000000000000000e SONAME               Library soname: [libdl.so.1]

Binutils:

Dynamic section at offset 0xd30 contains 25 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.7]
 0x000000000000000e (SONAME)             Library soname: [libdl.so.1]

Should we instead switch DT_NEEDED to be like DT_AUXILIARY? This would be similar to the format used by binutils readelf and ELF Tool Chain readelf.

Ah, now I see why I did it in that way for DT_AUXILIARY in D24138. I was wondering today why I implemented such a inconsistent output format that time :)
So do what other think ? Should we be consistent with other readelf utils it seems ?

grimar updated this revision to Diff 106592.Jul 14 2017, 2:03 AM
grimar edited the summary of this revision. (Show Details)
  • Make output format to be consistent with binutils/ELF Tool Chain readelf tools.
grimar updated this revision to Diff 106615.Jul 14 2017, 3:50 AM
  • Updated 2 more testcases affected.

One note, the ordering of the value tags differs wrt GNU ld. It shouldn't matter, just something I noticed.

GNU ld.bfd 2.17.50

  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.7]
 0x000000000000000e (SONAME)             Library soname: [libdl.so.1]
 0x000000007fffffff (FILTER)             Filter library: [libc.so.7]
 0x000000000000000c (INIT)               0x738
 0x000000000000000d (FINI)               0xa48
 0x0000000000000004 (HASH)               0x158
...

Patched lld

  Tag        Type                         Name/Value
 0x000000007fffffff (FILTER)             Filter library: [libc.so.7]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.7]
 0x000000000000000e (SONAME)             Library soname: [libdl.so.1]
 0x0000000000000007 (RELA)               0x6c0
 0x0000000000000008 (RELASZ)             96 (bytes)
...