Page MenuHomeFreeBSD

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

Authored by sobomax on Nov 21 2018, 3:40 PM.
Tags
None
Referenced Files
F102796575: D18290.diff
Sun, Nov 17, 7:46 AM
Unknown Object (File)
Thu, Nov 14, 7:18 PM
Unknown Object (File)
Mon, Nov 11, 1:30 AM
Unknown Object (File)
Oct 18 2024, 6:11 AM
Unknown Object (File)
Oct 17 2024, 4:31 PM
Unknown Object (File)
Oct 11 2024, 10:03 AM
Unknown Object (File)
Oct 4 2024, 5:09 AM
Unknown Object (File)
Oct 1 2024, 5:46 AM
Subscribers

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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable