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)
Sat, Jan 25, 9:19 PM
Unknown Object (File)
Sat, Jan 25, 7:57 PM
Unknown Object (File)
Fri, Jan 24, 4:57 PM
Unknown Object (File)
Mon, Jan 20, 11:11 PM
Unknown Object (File)
Fri, Jan 17, 1:11 PM
Unknown Object (File)
Sat, Jan 11, 11:28 AM
Unknown Object (File)
Sat, Jan 11, 4:36 AM
Unknown Object (File)
Sat, Jan 11, 4:36 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 21151