Page MenuHomeFreeBSD

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

Authored by sobomax on Nov 21 2018, 3:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 6 2024, 6:29 AM
Unknown Object (File)
Jan 11 2024, 1:16 AM
Unknown Object (File)
Dec 12 2023, 4:07 AM
Unknown Object (File)
Oct 12 2023, 3:22 AM
Unknown Object (File)
Sep 26 2023, 11:13 PM
Unknown Object (File)
Sep 6 2023, 8:36 AM
Unknown Object (File)
Aug 24 2023, 3:03 PM
Unknown Object (File)
Aug 7 2023, 12:22 PM
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