Page MenuHomeFreeBSD

As objdump is being phased out for 12.0, convert the small bit using it to using readelf.
ClosedPublic

Authored by mat on Jun 19 2018, 2:55 PM.

Details

Reviewers
emaste
Group Reviewers
portmgr
Commits
rP473605: Convert to readelf.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mat created this revision.Jun 19 2018, 2:55 PM

Reported in the PR -- nm might be more useful for this script.

I can also add --print-file-name to readelf though to make it always emit the File: line.

mat added a comment.Jun 20 2018, 8:50 AM

Mmmm,

$ readelf --print-file-name -r /usr/bin/mktemp
readelf: unrecognized option `--print-file-name'
In D15904#336884, @mat wrote:

Mmmm,

$ readelf --print-file-name -r /usr/bin/mktemp
readelf: unrecognized option `--print-file-name'

The option for readelf doesn't exist in HEAD yet, it's in review in D15908.

This looks fine to me. It's probably worth adding a comment explaining the use of ${NONEXISTENT} though.

mat added a comment.Jun 20 2018, 2:03 PM
In D15904#336884, @mat wrote:

Mmmm,

$ readelf --print-file-name -r /usr/bin/mktemp
readelf: unrecognized option `--print-file-name'

The option for readelf doesn't exist in HEAD yet, it's in review in D15908.

Ah, that is why, and this was on 10.4, so a bit far from HEAD :-)

This looks fine to me. It's probably worth adding a comment explaining the use of ${NONEXISTENT} though.

Yes, I have it in my local repository.

emaste added a subscriber: dim.Jun 20 2018, 2:17 PM

Another option: upon discussion with @dim we will likely end up installing llvm's llvm-objdump as objdump. It's broadly compatible, but the output format etc. might be slightly different.

Migrating to readelf is probably still the best option here though.

mat added a comment.Jun 20 2018, 2:32 PM

As the task is simple, the tool we actually end up using does not really matter.

What matters is that it is available on all supported releases :-)

mat updated this revision to Diff 44149.Jun 20 2018, 2:32 PM
  • Add a note about the ${NONEXISTENT} argument.
In D15904#336964, @mat wrote:

What matters is that it is available on all supported releases :-)

Indeed, and readelf will always be available.

This revision was not accepted when it landed; it landed in state Needs Review.Jun 30 2018, 8:37 AM
Closed by commit rP473605: Convert to readelf. (authored by mat). · Explain Why
This revision was automatically updated to reflect the committed changes.