Page MenuHomeFreeBSD

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

Authored by sobomax on Nov 21 2018, 3:40 PM.
Tags
None
Referenced Files
F107169280: D18290.id50894.diff
Sat, Jan 11, 4:36 AM
F107169265: D18290.id.diff
Sat, Jan 11, 4:36 AM
F107169238: D18290.id50905.diff
Sat, Jan 11, 4:35 AM
F107167000: D18290.diff
Sat, Jan 11, 3:46 AM
F107161314: D18290.diff
Sat, Jan 11, 1:49 AM
Unknown Object (File)
Sun, Dec 22, 7:14 PM
Unknown Object (File)
Sun, Dec 22, 7:14 PM
Unknown Object (File)
Nov 30 2024, 9:44 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