[PATCH v2 1/1] readelf: invalid error message triggered when last tag is an empty string
Matthieu Longo
matthieu.longo@arm.com
Mon Jun 23 09:23:16 GMT 2025
On 2025-06-23 06:53, Jan Beulich wrote:
> On 20.06.2025 17:13, Matthieu Longo wrote:
>> On 2025-06-20 09:40, Jan Beulich wrote:
>>> On 19.06.2025 10:43, Matthieu Longo wrote:
>>>> + print_symbol_name ((int) maxlen, (const char *) p);
>>>
>>> ... the function will bail early if passed 0.
>>>
>>> However - is using print_symbol_name() actually correct here? Surely it
>>> is bogus to demangle this string, in the (however unlikely) event that it
>>> turns out demanglable?
>>
>> I think that it is correct. It will print "[...]" for a string finishing
>> with no null terminator, but you can trigger the printing of the string
>> until a maximum of maxlen if you pass -T (--silent-truncation) to readelf.
>
> You don't touch on the demangling aspect at all?
>
> Jan
Demangling should not be needed for object attributes, but
print_symbol_name() has been working up until now, I don't have plan to
change it unless there is a good reason.
Do you mean by bogus here that a demangling could mistakenly be applied
on a non-mangled string starting with chance with _Z for instance ?
Matthieu
More information about the Binutils
mailing list