Page MenuHomeFreeBSD

readelf --debug-dump=decodedline produces incorrect results
ClosedPublic

Authored by sobomax on Nov 21 2018, 3:40 PM.

Details

Summary

While running readelf --debug-dump=decodedline on some of the binaries generated by our build I have noticed that the CU lines contain invalid pathnames. Apparently sometimes file field is filled with absolute path, so that prefixing it with directory is not needed.

Reproducing is extremely easy:

$ cd /usr/src
$ make buildworld
$ find /usr/obj -name \*.full | xargs readelf --debug-dump=decodedline | grep ^CU: | grep '//'
CU: /usr/obj/usr/src/tmp/usr/src/kerberos5/tools/asn1_compile//usr/src/crypto/heimdal/lib/asn1/gen.c
CU: /usr/obj/usr/src/tmp/usr/src/kerberos5/tools/asn1_compile//usr/src/crypto/heimdal/lib/asn1/gen_copy.c
CU: /usr/obj/usr/src/tmp/usr/src/kerberos5/tools/asn1_compile//usr/src/crypto/heimdal/lib/asn1/gen_decode.c

After the suggested fix has been applied output becomes correct:

CU: /usr/src/crypto/heimdal/lib/asn1/gen.c
CU: /usr/src/crypto/heimdal/lib/asn1/gen_copy.c
CU: /usr/src/crypto/heimdal/lib/asn1/gen_decode.c
Test Plan

Build world. Run readelf on its results, check to see that CU lines are correct.

Diff Detail

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

Event Timeline

sobomax created this revision.Nov 21 2018, 3:40 PM
sobomax edited the summary of this revision. (Show Details)Nov 21 2018, 3:44 PM
sobomax edited the summary of this revision. (Show Details)
emaste accepted this revision.Nov 21 2018, 3:54 PM
This revision is now accepted and ready to land.Nov 21 2018, 3:54 PM
sobomax edited the summary of this revision. (Show Details)Nov 21 2018, 4:47 PM
This revision was automatically updated to reflect the committed changes.