public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Fangrui Song <i@maskray.me>
To: Katharina Bogad <katharina@bogad.at>
Cc: Nick Clifton <nickc@redhat.com>,
	"binutils@sourceware.org" <binutils@sourceware.org>
Subject: Re: Readelf: --wide as default if output is redirected
Date: Thu, 17 Sep 2020 08:59:10 -0700	[thread overview]
Message-ID: <MWHPR12MB145657212B9E5A995F9AC4C3CB3E0@MWHPR12MB1456.namprd12.prod.outlook.com> (raw)
In-Reply-To: <B224734B-F220-4A9B-A686-708B95BFBFE0@bogad.at>

On Thu, Sep 17, 2020 at 3:36 AM Katharina Bogad via Binutils
<binutils@sourceware.org> wrote:
>
> 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

Yeah, I created an alias 're' for 'readelf -W'. Sometimes I need to
provide a command for others and omitting -W has always caused me
trouble.

To provide a data point, llvm-readelf supports only the wide format
and ignores --wide. It turns out that most projects don't need a
change.

  parent reply	other threads:[~2020-09-17 16:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16 16:06 Katharina Bogad
2020-09-16 18:01 ` H.J. Lu
2020-09-17  9:55 ` Nick Clifton
2020-09-17 10:36   ` Katharina Bogad
2020-09-17 15:37     ` Nick Clifton
2020-09-17 15:59     ` Fangrui Song [this message]
2020-09-18 13:57       ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MWHPR12MB145657212B9E5A995F9AC4C3CB3E0@MWHPR12MB1456.namprd12.prod.outlook.com \
    --to=i@maskray.me \
    --cc=binutils@sourceware.org \
    --cc=katharina@bogad.at \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).