https://sourceware.org/bugzilla/show_bug.cgi?id=23357
Bug ID: 23357 Summary: LD debug info cannot be read by valgrind Product: binutils Version: 2.32 (HEAD) Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: dilyan.palauzov at aegee dot org Target Milestone: --- Created attachment 11110 --> https://sourceware.org/bugzilla/attachment.cgi?id=11110&action=edit The object file in the experiments. I gcc (GCC) 7.3.1 20180629 compiled with mkdir build && cd build && ../configure --enable-threads=posix --enable-nls --disable-multilib --enable-interpreter --with-system-zlib --enable-libgcj-multifile --enable-languages=all --enable-targets=all --with-system-unwind --without-x --with-linker-hash-style=gnu --enable-shared --with-build-config=bootstrap-lto\ bootstrap-O3 && make install binutils 2.31.51.20180630 compiled with /git/binutils-gdb/configure --enable-threads --with-system-zlib --with-system-readline --with-python=/usr/local/bin/python3 --enable-compressed-debug-sections=gold,ld --enable-gold and this file: #include <stdio.h> int main() { printf("a\n"); int i = 7 /0; printf("b\n"); return 0; } which I compile with 'gcc -g -c -o t.o t.c'. Then I link the file with bfd and gold separately: gcc -fuse-ld=gold -o t-gold t.o gcc -fuse-ld=bfd -o t-bfd t.o t.o, t-gold and t-bfd are uploaded. Running under gdb shows for both t-binaries cases troubles in t.c:5. I have valgrind-3.14.0.GIT-f008d35bb3-20180629X. "valgrind ./t-gold" shows: Process terminating with default action of signal 8 (SIGFPE) Integer divide by zero at address 0x100905BADE at 0x400579: main (t.c:5) but "valgrind ./t-bfd" prints: Process terminating with default action of signal 8 (SIGFPE) Integer divide by zero at address 0x1008F5BADE at 0x401149: ??? (in /root/T/t-bfd) by 0x4A44B44: (below main) (libc-start.c:287) Installing a ld 2.30 under /usr/local/x86_64-pc-linux-gnu/bin/ld.bfd, doing 'gcc -fuse-ld=bfd -o t-bfd2.30 t.o' and then 'valgrind ./t-bfd2.30' prints Process terminating with default action of signal 8 (SIGFPE) Integer divide by zero at address 0x100905FADE at 0x4004F9: main (t.c:5) This means that valgrind cannot read debug information when most current ld is used, but can read the information when gold or ld 2.30 are used. The fact that gdb can read the information in all cases does not prove that the problem is in valgrind, it could be also in the common libbdf. Please verify that the debug information generated by ld is correct and help at https://bugs.kde.org/show_bug.cgi?id=395682 to find what the problem with valgrind is. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils