Bug 216878 - BSD readelf -d output is slightly incompatible with GNU readelf
Summary: BSD readelf -d output is slightly incompatible with GNU readelf
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-toolchain (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-07 11:03 UTC by Jan Beich
Modified: 2018-09-01 01:54 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2017-02-07 11:03:57 UTC
GNU readelf wraps type value with parentheses. To avoid bugs like in See Also it'd be nice if BSD readelf would follow the suit.

- 0x0000000000000001 (NEEDED)             Shared library: [libc++.so.1]
+ 0x0000000000000001 NEEDED               Shared library: [libc++.so.1]
Comment 1 Ed Maste freebsd_committer freebsd_triage 2017-02-07 21:51:13 UTC
Added ELF Tool Chain ticket: https://sourceforge.net/p/elftoolchain/tickets/544/

Note that elfutils eu-readelf does not include parentheses:
% eu-readelf -d /bin/ls

Dynamic segment contains 28 entries:
 Addr: 0x0000000000607028  Offset: 0x007028  Link to section: [ 6] '.dynstr'
  Type              Value
  NEEDED            Shared library: [libutil.so.9]
  NEEDED            Shared library: [libncurses.so.8]
  NEEDED            Shared library: [libc.so.7]
  INIT              0x00000000004018c8
  FINI              0x0000000000405dd8
...
so there's some argument that scripts parsing readelf output should be tolerant of different formats, looking for just NEEDED
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2017-02-07 22:31:14 UTC
Note that this was already raised in the past and the result of the discussion was this won't change iirc and we adapted the readelf consumers in base and the ports framework for compatiblity
Comment 3 Ed Maste freebsd_committer freebsd_triage 2017-02-07 23:35:31 UTC
(In reply to Baptiste Daroussin from comment #2)
Do you have a link to that discussion? I recall that we had it, but can't find it now.
Comment 4 Ed Maste freebsd_committer freebsd_triage 2018-09-01 01:54:32 UTC
Issue was discussed and we decided to keep the paren-less version.