]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove "alias" hack from add_symbol_to_list
authorTom Tromey <tom@tromey.com>
Sun, 18 Jan 2026 17:42:34 +0000 (10:42 -0700)
committerTom Tromey <tom@tromey.com>
Tue, 20 Jan 2026 02:44:08 +0000 (19:44 -0700)
add_symbol_to_list has this code:

  /* If this is an alias for another symbol, don't add it.  */
  if (symbol->linkage_name () && symbol->linkage_name ()[0] == '#')
    return;

This appears to be an old stabs hack.  In the stabs removal patch
(commit eaea19f98d8) we see:

-  /* '#' is a GNU C extension to allow one symbol to refer to another
-     related symbol.
-
-     Generally this is used so that an alias can refer to its main
-     symbol.  */

This is a classic example of an old style problem that gdb had:
sometimes hacks were added to the gdb core to work around problems in
symbol readers -- IMO this kind of thing should have always been
handled by the stabs reader itself, not add_symbol_to_list.

Anyway, this is obsolete now and this patch removes it.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/buildsym.c

index 7a468076c549b947f5d9b591790c8ee9472b87ea..d13b17038b2fcd59a7c54c86d4b558e66b751393 100644 (file)
@@ -98,10 +98,6 @@ buildsym_compunit::get_macro_table ()
 void
 add_symbol_to_list (symbol *symbol, std::vector<struct symbol *> &list)
 {
-  /* If this is an alias for another symbol, don't add it.  */
-  if (symbol->linkage_name () && symbol->linkage_name ()[0] == '#')
-    return;
-
   list.push_back (symbol);
 }