Avoid crash with Ada and -fdata-sections
authorTom Tromey <tromey@adacore.com>
Thu, 17 Aug 2023 14:08:42 +0000 (08:08 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 5 Sep 2023 15:48:24 +0000 (09:48 -0600)
commit655e4e52ef44c1670a3b6f979b85534279c9f6c1
tree9c17371de7a2952fc862d2df0283b91134eed174
parentb6ac461ace19ba19aaf135a028df4e67e47e21d7
Avoid crash with Ada and -fdata-sections

A user noticed that gdb would crash when showing a backtrace.
Investigation showed this to be a crash in the DWARF reader when
handling a "pragma export" symbol.  The bug here is that earlier code
decides to eliminate the symbol, but the export code tries to add it
anyway -- but to a NULL list.
gdb/dwarf2/read.c
gdb/testsuite/gdb.ada/data-sections.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/data-sections/main.adb [new file with mode: 0644]