]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gprofng: do not skip weak symbols
authorDmitrii Bordukov <dabordukov@gmail.com>
Sat, 19 Jul 2025 12:21:46 +0000 (15:21 +0300)
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Sat, 19 Jul 2025 19:54:32 +0000 (12:54 -0700)
PR gprofng/33151

gprofng ignores functions that are compiled as weak symbols. This
heavily affects C++ class methods that are always compiled by g++
and clang++ as weak symbols. In this case 'gprofng display text'
just displays <static>@ADDRESS(<FILENAME>) instead of proper method
name.

The bug has been introduced in the commit 470a0288a818.

gprofng/src/Stabs.cc

index 116316ed5b65201491de22f674db49adf51cc495..20bdf8ba663ed663fe0ac234a1c313b32d813372 100644 (file)
@@ -1546,7 +1546,7 @@ Stabs::readSymSec (Elf *elf, bool is_dynamic)
       switch (GELF_ST_TYPE (Sym.st_info))
        {
        case STT_FUNC:
-         if (Sym.st_size == 0 || ELF_ST_BIND (Sym.st_info) == STB_WEAK)
+         if (Sym.st_size == 0)
            break;
          if (Sym.st_shndx == 0)
            {