Bug 29192 - addr2line suspected incompatibility with DWARF5
Summary: addr2line suspected incompatibility with DWARF5
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.38
: P2 normal
Target Milestone: 2.39
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-27 13:31 UTC by Ofek Shilon
Modified: 2022-06-15 06:44 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ofek Shilon 2022-05-27 13:31:14 UTC
==========Example:
$ cat toy.cpp
#include <iostream>
int main() {
        std::cout << "hello world";
        return 0;
}
$ clang-14 -g -stdlib=libc++ -lc++ -I/usr/lib/llvm-14/include/c++/v1 toy.cpp -o toy14
$ addr2line -fe ./toy 0x1234
addr2line: DWARF error: invalid or unhandled FORM value: 0x25
main
??:?
=========end example

According to the dwarf5 spec (https://dwarfstd.org/doc/DWARF5.pdf), section 7.5.6 page 221, 0x25 is a valid DW_FORM value:

      DW_FORM_strx1 ‡ 0x25 string.


In other cases (not yet reduced to a small repro) we see:
  addr2line: Dwarf Error: Could not find abbrev number 127
Comment 1 Ofek Shilon 2022-05-27 13:46:41 UTC
(1) Sorry, typo in the example -
instead of
$ addr2line -fe ./toy 0x1234
should be -
$ addr2line -fe ./toy14 0x1234

Also, just verified that if I build with `-fdebug-default-version=4` the error disappears and lines are displayed properly.
Comment 2 Alan Modra 2022-06-15 06:44:32 UTC
Fixed for 2.39 with commit f67741e172 and 31d6c13def