[gdb/symtab] Work around PR gas/29517, dwarf2 case
commit5ce0e02478cc79a260c7e29822450284a32b9b12
authorTom de Vries <tdevries@suse.de>
Thu, 2 May 2024 07:34:46 +0000 (2 09:34 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 2 May 2024 07:34:46 +0000 (2 09:34 +0200)
tree5051c2b270968675b28e62d7535d791f99d63032
parent75d933919d8e99c85054bdbf3a0bee0235f2bd3b
[gdb/symtab] Work around PR gas/29517, dwarf2 case

In commit 1d45d90934b ("[gdb/symtab] Work around PR gas/29517") we added a
workaround for PR gas/29517.

The problem is present in gas version 2.39, and fixed in 2.40, so the
workaround is only active for gas version == 2.39.

However, the problem in gas is only fixed for dwarf version >= 3, which
supports DW_TAG_unspecified_type.

Fix this by also activating the workaround for dwarf version == 2.

Tested on x86_64-linux.

Approved-by: Kevin Buettner <kevinb@redhat.com>
PR symtab/31689
https://sourceware.org/bugzilla/show_bug.cgi?id=31689
gdb/dwarf2/read.c
gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c
gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c
gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp