From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 7EF4D385842B; Mon, 25 Apr 2022 13:26:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7EF4D385842B Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Do not put linkage names into .gdb_index X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 0d38576a34ec64a1b4500c9277a8e9d0f07e6774 X-Git-Newrev: 2cf349be0e378fdedcb7d0b19dbc431df524cbe7 Message-Id: <20220425132654.7EF4D385842B@sourceware.org> Date: Mon, 25 Apr 2022 13:26:54 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2022 13:26:54 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D2cf349be0e37= 8fdedcb7d0b19dbc431df524cbe7 commit 2cf349be0e378fdedcb7d0b19dbc431df524cbe7 Author: Tom Tromey Date: Fri Apr 22 11:44:59 2022 -0600 Do not put linkage names into .gdb_index =20 This changes the .gdb_index writer to skip linkage names. This was always done historically (though somewhat implicitly). Diff: --- gdb/dwarf2/index-write.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c index b7a2e214f6b..afe55da6c1b 100644 --- a/gdb/dwarf2/index-write.c +++ b/gdb/dwarf2/index-write.c @@ -1093,6 +1093,14 @@ write_cooked_index (cooked_index_vector *table, { for (const cooked_index_entry *entry : table->all_entries ()) { + /* GDB never put linkage names into .gdb_index. The theory here + is that a linkage name will normally be in the minimal + symbols anyway, so including it in the index is usually + redundant -- and the cases where it would not be redundant + are rare and not worth supporting. */ + if ((entry->flags & IS_LINKAGE) !=3D 0) + continue; + const auto it =3D cu_index_htab.find (entry->per_cu); gdb_assert (it !=3D cu_index_htab.cend ());