]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Avoid race when reading dwz file
authorTom Tromey <tom@tromey.com>
Thu, 25 Jan 2024 13:48:22 +0000 (06:48 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 8 Mar 2024 14:15:08 +0000 (07:15 -0700)
commite9b738dfbdc504589e1a365ce32981f4b23c22c3
tree289bc9e3c5315007ac2f9ab9dae5a6994ccbf83e
parentcdabd12b186e8e794045372b753416a18c387d7b
Avoid race when reading dwz file

PR gdb/31260 points out a race introduced by the background reading
changes.  If a given objfile is re-opened when it is already being
read, dwarf2_initialize_objfile will call dwarf2_read_dwz_file again,
causing the 'dwz_file' to be reset.

This patch fixes the problem by arranging to open the dwz just once:
when the dwarf2_per_bfd object is created.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31260
gdb/dwarf2/dwz.c
gdb/dwarf2/read.c