https://bugs.llvm.org/show_bug.cgi?id=47781
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: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected],
[email protected]
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
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions
-fstack-protector-strong -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-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._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs