[PATCH] [PATCH] gprofng: do not skip weak symbols [try 2]

Sam James sam@gentoo.org
Sat Jul 19 20:10:49 GMT 2025


Vladimir Mezentsev via Binutils <binutils@sourceware.org> writes:

> Please push your fix to the master branch.
>
> Is it OK to push this patch to the 2.45 branch ?

You need to ask Nick.

>
> -Vladimir
>
>
> On 7/18/25 13:48, Dmitrii Bordukov wrote:
>> 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 | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/gprofng/src/Stabs.cc b/gprofng/src/Stabs.cc
>> index 116316ed5b6..a5e24f593e5 100644
>> --- a/gprofng/src/Stabs.cc
>> +++ b/gprofng/src/Stabs.cc
>> @@ -1,4 +1,4 @@
>> -/* Copyright (C) 2021-2025 Free Software Foundation, Inc.
>> +
>>      Contributed by Oracle.
>>        This file is part of GNU Binutils.
>> @@ -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)
>>   	    {


More information about the Binutils mailing list