[PATCH v2 1/1] readelf: invalid error message triggered when last tag is an empty string
Jan Beulich
jbeulich@suse.com
Mon Jun 23 14:19:22 GMT 2025
On 23.06.2025 14:56, Matthieu Longo wrote:
> On 2025-06-23 12:07, Richard Earnshaw (lists) wrote:
>> On 23/06/2025 10:48, Jan Beulich wrote:
>>
>>> (It's likely even wrong to call it for e.g.
>>> section names, for the same reason.)
>>
>> I think that's probably intended to handle cases like compiling C++ with -ffunction-sections. In that case you get things like:
>>
>> int f(int a) {
>> return a + 1;
>> }
>>
>> g++ -ffunction-sections -S -o - x.cc | grep .section
>>
>> .section .text._Z1fi,"ax",@progbits
>>
>> and really want to see that this is for f(int).
>>
>> It happens not to work though - I don't think the demangler can decode this when the leading ".text." is prepended to the section name.
>
> @Jan, @Richard:
> Since it is not directly related to the issue addressed by the patch,
> could we fix this another time ?
Perhaps. I brought this up because if we wanted to avoid that function here,
the fix would want to look differently. If, as Richard suggests, we may want
to continue using that function, dealing with the anomaly observed could of
course be done separately.
Jan
More information about the Binutils
mailing list