Bug 26914 - Disassembling create DWARF Errors
Summary: Disassembling create DWARF Errors
Status: RESOLVED DUPLICATE of bug 26520
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.35
: P2 critical
Target Milestone: ---
Assignee: Nick Clifton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-18 10:54 UTC by Veit Devil
Modified: 2022-06-22 06:29 UTC (History)
1 user (show)

See Also:
Host:
Target: avr
Build:
Last reconfirmed: 2020-11-19 00:00:00


Attachments
compiled with binutils 2.34 and 2.35.1 (64.53 KB, application/x-zip-compressed)
2020-11-18 10:54 UTC, Veit Devil
Details
Everything necessary for your test should be in the appendix. Thank you. (76.46 KB, application/x-zip-compressed)
2020-11-19 19:11 UTC, Veit Devil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Veit Devil 2020-11-18 10:54:02 UTC
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.
Comment 1 Nick Clifton 2020-11-19 11:49:57 UTC
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
Comment 2 Veit Devil 2020-11-19 13:02:22 UTC
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
Comment 3 Nick Clifton 2020-11-19 17:33:25 UTC
(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
Comment 4 Veit Devil 2020-11-19 19:09:55 UTC
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
Comment 5 Veit Devil 2020-11-19 19:11:59 UTC
Created attachment 12980 [details]
Everything necessary for your test should be in the appendix. Thank you.
Comment 6 Nick Clifton 2020-11-20 11:24:48 UTC
(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 ***
Comment 7 Veit Devil 2020-11-20 12:29:31 UTC
Hi Nivk,

okay, thank you so much for taking the time for this.

Bye
Veit