[PATCH v2 1/1] readelf: invalid error message triggered when last tag is an empty string

Richard Earnshaw (lists) Richard.Earnshaw@arm.com
Mon Jun 23 11:07:02 GMT 2025


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.)
> 
> Jan

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.

R


More information about the Binutils mailing list