Don't use objfile::intern in DWO code
authorTom Tromey <tom@tromey.com>
Sun, 12 Nov 2023 16:23:49 +0000 (09:23 -0700)
committerTom Tromey <tom@tromey.com>
Tue, 9 Jan 2024 01:40:21 +0000 (18:40 -0700)
commit3c2f688e70997bcdc856578adbed492a0b581fa9
tree8708968d390bbafc5e1be8aa595f73aaad673852
parent7531822f109138039881f0427ccdfd760ec19e07
Don't use objfile::intern in DWO code

The DWO code in the DWARF reader currently uses objfile::intern.  This
accesses a shared data structure and so would be racy when used from
multiple threads.  I don't believe this can happen right now, but
background reading could provoke this, and in any case it's better to
avoid this, just to be sure.

This patch changes this code to just use a std::string.  A new type is
introduced to do hash table lookups, to avoid unnecessary copies.
gdb/dwarf2/read.c