[llvm-bugs] [Bug 47781] New: Intruction incorrectly marked as not mappable back to source code

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 9 07:07:32 PDT 2020


            Bug ID: 47781
           Summary: Intruction incorrectly marked as not mappable back to
                    source code
           Product: libraries
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: wcohen at redhat.com
                CC: jdevlieghere at apple.com, keith.walker at arm.com,
                    llvm-bugs at lists.llvm.org,
                    paul_robinson at playstation.sony.com

When reviewing the binaries of programs build with clang-10.0.1-2.fc32.x86_64
on fedora 32 with "eu-readelf --debug-dump=decodedline" I found that clang
appeared to incorrectly state that one of the instructions in the executable
could not be mapped back to the source code.  This can be observed build a
small rpm package on Fedora 32.  

Get the heapsort-0.5-fc32.src.rpm from
https://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps .
Then following the steps below to build the binary:

sudo dnf build-dep ./heapsort-0.5-fc32.src.rpm
rpm -Uvh heapsort-0.5-fc32.src.rpm
cd ~/rpmbuild/SPECS
export CC=clang
export CXX=clang++
rpmbuild --define '%optflags  -O2 -g  -pipe -Wall -Werror=format-security
-fstack-protector-strong -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fcf-protection -Wno-narrowing
-Wno-unused-command-line-argument' -bc heapsort.spec

The issue can be seen in the resulting heapsort binary:

cd ~/rpmbuild/BUILD/heapsort-0.5
eu-readelf --debug-dump=decodedline ./heapsort

The output of eu-readelf has:

     0:14           0   0  0 0x0000000000401202 <main+0x42>

Looking at the dissembly of the code produced with "objdump -d
heapsort" this instruction is a zeroing of the register used for the
variable of i:

  401202:       31 db                   xor    %ebx,%ebx

Would expect that the eu-readelf output be (the "i=0" in the source code):

     97:9           0   0  0 0x0000000000401202 <main+0x42>

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201009/8b260cb4/attachment.html>

More information about the llvm-bugs mailing list