Readelf: --wide as default if output is redirected

Katharina Bogad katharina@bogad.at
Thu Sep 17 10:36:29 GMT 2020


Hi Nick, 

> Which version of readelf ?  

2.31 and 2.24. I am kind of stuck with the latter one because it belongs to
an embedded systems development SDK I have no control over.

> I added a new feature to the 2.35 release so that by default readelf will 
> suffix truncated symbol names with "[...]", thus letting the reader know
> that the name has been abbreviated.

Yeah, that at least makes it obvious. Thank you!

> Yeah, I think that changing the default behaviour like this would be a bad
> idea.  But of course you can always create a wrapper script that adds the --wide
> option (and maybe invokes the pager at the same time).

Well, my argument would be that redirection is good for basically three
things:
  - archival
  - automated processing
  - reading in a pager

Truncating the output IMO does not add value in any of these cases; with
the obvious exception being pagers that can’t be configured to not wrap lines.
In fact, I’d make the argument that it is counter-productive for archival and
automated processing (you’d have to pass --wide anyways to get accurate
results, and it was definitely a gotcha for me, making the behaviour non-
obvious). Maybe I am missing something, but I can’t think of a use-case 
where truncating would add value besides viewing in a width-restricted 
terminal.

But really, I’m fine either way. Future me will thank you for the dots once I 
forget that --wide is a thing and binutils >=2.35 has hit my toolchains.

Best,
Katharina


More information about the Binutils mailing list