public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Pete Dietl <petedietl@gmail.com>
To: binutils@sourceware.org
Subject: Readelf section header printing alignment
Date: Tue, 26 Dec 2023 15:01:16 -0800	[thread overview]
Message-ID: <CACB-c0GfaStgy+7WFF-70qsGh8qbgzgVP3Jzdz_6ejwe5JiKww@mail.gmail.com> (raw)

The section headers output from readelf with the '-W' option become ugly and
unaligned when a section name is too long.
Example:

Section Headers:
  [Nr] Name              Type            Address          Off    Size
 ES Flg Lk Inf Al
  [ 0]                   NULL            0000000000000000 000000
000000 00      0   0  0
  [ 1] .text             PROGBITS        0000000000000000 000040
00000f 00  AX  0   0  1
  [ 2] .data             PROGBITS        0000000000000000 00004f
000000 00  WA  0   0  1
  [ 3] .bss              NOBITS          0000000000000000 00004f
000000 00  WA  0   0  1
  [ 4] .comment          PROGBITS        0000000000000000 00004f
00002c 01  MS  0   0  1
  [ 5] .note.GNU-stack   PROGBITS        0000000000000000 00007b
000000 00      0   0  1
  [ 6] .note.gnu.property NOTE            0000000000000000 000080
000020 00   A  0   0  8
  [ 7] .eh_frame         PROGBITS        0000000000000000 0000a0
000038 00   A  0   0  8
  [ 8] .rela.eh_frame    RELA            0000000000000000 000148
000018 18   I  9   7  8
  [ 9] .symtab           SYMTAB          0000000000000000 0000d8
000060 18     10   3  8
  [10] .strtab           STRTAB          0000000000000000 000138
00000d 00      0   0  1
  [11] .shstrtab         STRTAB          0000000000000000 000160
000067 00      0   0  1

May I submit a patch to compute the amount of space between 'Name' and 'Type'
from the longest of the section header names, or is this just a silly
formatting detail that no one cares about? :)

Thanks,
Pete

             reply	other threads:[~2023-12-26 23:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26 23:01 Pete Dietl [this message]
2023-12-26 23:59 ` Mike Frysinger
2024-01-05 15:12 ` Nick Clifton
2024-01-06  6:55   ` Fangrui Song

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=CACB-c0GfaStgy+7WFF-70qsGh8qbgzgVP3Jzdz_6ejwe5JiKww@mail.gmail.com \
    --to=petedietl@gmail.com \
    --cc=binutils@sourceware.org \
    /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).