Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Nov 2022 06:37:45 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 268071] elftoolchain readelf: feature to force display filename
Message-ID:  <bug-268071-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D268071

            Bug ID: 268071
           Summary: elftoolchain readelf: feature to force display
                    filename
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: tatsuki_makino@hotmail.com

Created attachment 238439
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D238439&action=
=3Dedit
experimental patch

readelf displays file names when 2 or more files are given as arguments.
However, find exec and xargs are sometimes executed with 1 argument, so the
last file name may not be known.

for example,
find -s /usr/local/lib -type f -name lib\* -exec readelf -h {} +
find -s /usr/local/lib -type f -name lib\* -print0 | xargs -0 readelf -h

If the argument is limited to one, the filename is never known.

for example,
find -s /usr/local/lib -type f -name lib\* -exec readelf -h {} \;
find -s /usr/local/lib -type f -name lib\* -print0 | xargs -0 -L 1 readelf =
-h

A modification like the patch will force readelf to display the filename by
option.

How to use
find -s /usr/local/lib -type f -name lib\* -exec readelf --display-filename=
 -h
{} \;
find -s /usr/local/lib -type f -name lib\* -print0 | xargs -0 -L 1 readelf
--display-filename -h

I sometimes want to run readelf on the pkg info -lq results :)
pkg info -l -q something | xargs readelf --display-filename -d -s

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-268071-227>