Created attachment 12973 [details] compiled with binutils 2.34 and 2.35.1 Hello, i have noticed that C++ programs compiled with binutils 2.35 or 2.35.1 often produce DWARF errors when disassembling them. Whereby avr-gcc does not play a role according to my tests. I have done comparison tests with binutils 2.34, 2.35 and 2.35.1 with avr-gcc 9.3, 10.1.0 and 10.2.0 respectively. I attach two example files. What was compiled with which version is shown in the file name. In my opinion this concerns the obj-dump.exe of binutils 2.35 and 2.35.1. I can disassemble both .elf files with the obj-dump.exe of binutils 2.34 without errors. When I use the obj-dump.exe of 2.35 or 2.35.1 I get DWARF Errors. This problem occurs more often when programming something with pointers. My feeling tells me. The C++ program compilation itself doesn't produce any errors, also no warnings and the generated program works.
Hi Veit, What are the DWARF errors that you are seeing ? We have recently fixed several bugs with the decoding of DWARF information by both objdump and readelf, so if you are able to try a version of either built from the current mainline development sources, you may find that the bug has already been fixed. Cheers Nick
Hi Nick, is binutils 2.35.1 not the latest version? according to https://ftp.gnu.org/gnu/binutils/ this is the latest version. The following messages are displayed. DWARF error: could not find variable specification at offset 15ee DWARF error: could not find variable specification at offset 15fa DWARF error: could not find variable specification at offset 1606 DWARF error: could not find variable specification at offset 1612 DWARF error: could not find variable specification at offset 161e DWARF error: could not find variable specification at offset 162a DWARF error: could not find variable specification at offset 1636 DWARF error: could not find variable specification at offset 1642 DWARF error: could not find variable specification at offset 164e DWARF error: could not find variable specification at offset 165a Bye Veit
(In reply to Veit Devil from comment #2) > is binutils 2.35.1 not the latest version? Latest released version yes. But not the most recent development version. The fixes that I mentioned are in the development sources, and should appear in the next official release. > DWARF error: could not find variable specification at offset 15ee This looks like a duplicate of bug 26520: https://sourceware.org/bugzilla/show_bug.cgi?id=26520 If you can upload a test binary then I can confirm this theory. Cheers Nick
Hi Nick, good, then I will wait for the next release version. Everything necessary for your test should be in the appendix. Thank you. Bye Veit
Created attachment 12980 [details] Everything necessary for your test should be in the appendix. Thank you.
(In reply to Veit Devil from comment #4) > good, then I will wait for the next release version. Everything necessary > for your test should be in the appendix. Thank you. Fair enough. I have tested the sketch_nov14a.ino.elf file with a development version of readelf and it does not show any errors, so I think that we can close this PR. *** This bug has been marked as a duplicate of bug 26520 ***
Hi Nivk, okay, thank you so much for taking the time for this. Bye Veit