Bug 24887 - readelf --notes: left justify "Data size"
Summary: readelf --notes: left justify "Data size"
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.33
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-07 05:41 UTC by Fangrui Song
Modified: 2019-09-18 18:20 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fangrui Song 2019-08-07 05:41:33 UTC
% readelf -n core
...
  Owner                 Data size       Description                                                               
  CORE                 0x00000150       NT_PRSTATUS (prstatus structure)

"Data size" is right justified. It will look slightly better if it is left justified, to be consistent with "Owner" and "Description":

--- i/binutils/readelf.c
+++ w/binutils/readelf.c
@@ -19184 +19184 @@ process_notes_at (Filedata *           filedata,
-  printf (_("  %-20s %10s\tDescription\n"), _("Owner"), _("Data size"));
+  printf (_("  %-20s %-10s\tDescription\n"), _("Owner"), _("Data size"));


% readelf -n core
...
  Owner                Data size        Description                                                            
  CORE                 0x00000150       NT_PRSTATUS (prstatus structure)
Comment 1 Sourceware Commits 2019-08-08 16:06:40 UTC
The master branch has been updated by Nick Clifton <nickc@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=dbe15e4e1dda8e20cc347ced751631d49a5f57de

commit dbe15e4e1dda8e20cc347ced751631d49a5f57de
Author: Nick Clifton <nickc@redhat.com>
Date:   Thu Aug 8 17:04:31 2019 +0100

    Change the output of readelf's note display so that the "Data size" column header is left justified.
    
    	PR 24887
    binutils* readelf.c (process_notes_at): Left justify the "Data size"
    	column heading.
    	* testsuite/binutils-all/i386/empty.d: Adjust for new output format.
    	* testsuite/binutils-all/i386/ibt.d: Likewise.
    	* testsuite/binutils-all/i386/pr21231a.d: Likewise.
    	* testsuite/binutils-all/i386/pr21231b.d: Likewise.
    	* testsuite/binutils-all/i386/shstk.d: Likewise.
    	* testsuite/binutils-all/note-2-32.d: Likewise.
    	* testsuite/binutils-all/note-2-64.d: Likewise.
    	* testsuite/binutils-all/x86-64/empty-x32.d: Likewise.
    	* testsuite/binutils-all/x86-64/empty.d: Likewise.
    	* testsuite/binutils-all/x86-64/ibt-x32.d: Likewise.
    	* testsuite/binutils-all/x86-64/ibt.d: Likewise.
    	* testsuite/binutils-all/x86-64/pr21231a.d: Likewise.
    	* testsuite/binutils-all/x86-64/pr21231b.d: Likewise.
    	* testsuite/binutils-all/x86-64/pr23494a-x32.d: Likewise.
    	* testsuite/binutils-all/x86-64/pr23494a.d: Likewise.
    	* testsuite/binutils-all/x86-64/pr23494c-x32.d: Likewise.
    	* testsuite/binutils-all/x86-64/pr23494c.d: Likewise.
    	* testsuite/binutils-all/x86-64/pr23494d-x32.d: Likewise.
    	* testsuite/binutils-all/x86-64/pr23494d.d: Likewise.
    	* testsuite/binutils-all/x86-64/pr23494e-x32.d: Likewise.
    	* testsuite/binutils-all/x86-64/pr23494e.d: Likewise.
    	* testsuite/binutils-all/x86-64/shstk-x32.d: Likewise.
    	* testsuite/binutils-all/x86-64/shstk.d: Likewise.
    
    ld	* testsuite/ld-aarch64/bti-plt-2.d: Adjust for new output format
    	from readelf.
    	* testsuite/ld-aarch64/bti-plt-4.d: Likewise.
    	* testsuite/ld-aarch64/bti-plt-6.d: Likewise.
    	* testsuite/ld-aarch64/bti-plt-7.d: Likewise.
    	* testsuite/ld-aarch64/bti-warn.d: Likewise.
    	* testsuite/ld-aarch64/property-bti-pac1.d: Likewise.
    	* testsuite/ld-aarch64/property-bti-pac2.d: Likewise.
    	* testsuite/ld-aarch64/property-bti-pac3.d: Likewise.
    	* testsuite/ld-elf/x86-feature-1a.rd: Likewise.
    	* testsuite/ld-elf/x86-feature-1b.rd: Likewise.
    	* testsuite/ld-elf/x86-feature-1c.rd: Likewise.
    	* testsuite/ld-elf/x86-feature-1d.rd: Likewise.
    	* testsuite/ld-elf/x86-feature-1e.rd: Likewise.
    	* testsuite/ld-i386/ibt-plt-2d.d: Likewise.
    	* testsuite/ld-i386/ibt-plt-3d.d: Likewise.
    	* testsuite/ld-i386/pr23372a.d: Likewise.
    	* testsuite/ld-i386/pr23372c.d: Likewise.
    	* testsuite/ld-i386/pr23486a.d: Likewise.
    	* testsuite/ld-i386/pr23486b.d: Likewise.
    	* testsuite/ld-i386/pr23486c.d: Likewise.
    	* testsuite/ld-i386/pr23486d.d: Likewise.
    	* testsuite/ld-i386/pr24322a.d: Likewise.
    	* testsuite/ld-i386/pr24322b.d: Likewise.
    	* testsuite/ld-i386/property-x86-3.d: Likewise.
    	* testsuite/ld-i386/property-x86-4a.d: Likewise.
    	* testsuite/ld-i386/property-x86-5.d: Likewise.
    	* testsuite/ld-i386/property-x86-cet1.d: Likewise.
    	* testsuite/ld-i386/property-x86-cet2a.d: Likewise.
    	* testsuite/ld-i386/property-x86-cet5a.d: Likewise.
    	* testsuite/ld-i386/property-x86-cet5b.d: Likewise.
    	* testsuite/ld-i386/property-x86-ibt1a.d: Likewise.
    	* testsuite/ld-i386/property-x86-ibt1b.d: Likewise.
    	* testsuite/ld-i386/property-x86-ibt2.d: Likewise.
    	* testsuite/ld-i386/property-x86-ibt3a.d: Likewise.
    	* testsuite/ld-i386/property-x86-ibt3b.d: Likewise.
    	* testsuite/ld-i386/property-x86-ibt4.d: Likewise.
    	* testsuite/ld-i386/property-x86-ibt5.d: Likewise.
    	* testsuite/ld-i386/property-x86-shstk1a.d: Likewise.
    	* testsuite/ld-i386/property-x86-shstk1b.d: Likewise.
    	* testsuite/ld-i386/property-x86-shstk2.d: Likewise.
    	* testsuite/ld-i386/property-x86-shstk3a.d: Likewise.
    	* testsuite/ld-i386/property-x86-shstk3b.d: Likewise.
    	* testsuite/ld-i386/property-x86-shstk4.d: Likewise.
    	* testsuite/ld-i386/property-x86-shstk5.d: Likewise.
    	* testsuite/ld-x86-64/ibt-plt-2d-x32.d: Likewise.
    	* testsuite/ld-x86-64/ibt-plt-2d.d: Likewise.
    	* testsuite/ld-x86-64/ibt-plt-3d-x32.d: Likewise.
    	* testsuite/ld-x86-64/ibt-plt-3d.d: Likewise.
    	* testsuite/ld-x86-64/pr23372a-x32.d: Likewise.
    	* testsuite/ld-x86-64/pr23372a.d: Likewise.
    	* testsuite/ld-x86-64/pr23372c-x32.d: Likewise.
    	* testsuite/ld-x86-64/pr23372c.d: Likewise.
    	* testsuite/ld-x86-64/pr23486a-x32.d: Likewise.
    	* testsuite/ld-x86-64/pr23486a.d: Likewise.
    	* testsuite/ld-x86-64/pr23486b-x32.d: Likewise.
    	* testsuite/ld-x86-64/pr23486b.d: Likewise.
    	* testsuite/ld-x86-64/pr23486c-x32.d: Likewise.
    	* testsuite/ld-x86-64/pr23486c.d: Likewise.
    	* testsuite/ld-x86-64/pr23486d-x32.d: Likewise.
    	* testsuite/ld-x86-64/pr23486d.d: Likewise.
    	* testsuite/ld-x86-64/pr24322a-x32.d: Likewise.
    	* testsuite/ld-x86-64/pr24322a.d: Likewise.
    	* testsuite/ld-x86-64/pr24322b-x32.d: Likewise.
    	* testsuite/ld-x86-64/pr24322b.d: Likewise.
    	* testsuite/ld-x86-64/pr24458a-x32.d: Likewise.
    	* testsuite/ld-x86-64/pr24458a.d: Likewise.
    	* testsuite/ld-x86-64/pr24458b-x32.d: Likewise.
    	* testsuite/ld-x86-64/pr24458b.d: Likewise.
    	* testsuite/ld-x86-64/pr24458c-x32.d: Likewise.
    	* testsuite/ld-x86-64/pr24458c.d: Likewise.
    	* testsuite/ld-x86-64/property-1.r: Likewise.
    	* testsuite/ld-x86-64/property-1a.r: Likewise.
    	* testsuite/ld-x86-64/property-2.r: Likewise.
    	* testsuite/ld-x86-64/property-2a.r: Likewise.
    	* testsuite/ld-x86-64/property-3.r: Likewise.
    	* testsuite/ld-x86-64/property-3a.r: Likewise.
    	* testsuite/ld-x86-64/property-4.r: Likewise.
    	* testsuite/ld-x86-64/property-4a.r: Likewise.
    	* testsuite/ld-x86-64/property-5.r: Likewise.
    	* testsuite/ld-x86-64/property-5a.r: Likewise.
    	* testsuite/ld-x86-64/property-6.r: Likewise.
    	* testsuite/ld-x86-64/property-7.r: Likewise.
    	* testsuite/ld-x86-64/property-7a.r: Likewise.
    	* testsuite/ld-x86-64/property-x86-3-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-3.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-4a-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-4a.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-5-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-5.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-cet1-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-cet1.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-cet2a-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-cet2a.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-cet5a-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-cet5a.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-cet5b-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-cet5b.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt1a-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt1a.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt1b-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt1b.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt2-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt2.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt3a-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt3a.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt3b-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt3b.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt4-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt4.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt5-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-ibt5.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk1a-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk1a.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk1b-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk1b.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk2-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk2.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk3a-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk3a.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk3b-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk3b.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk4-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk4.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk5-x32.d: Likewise.
    	* testsuite/ld-x86-64/property-x86-shstk5.d: Likewise.
    
    gas	* testsuite/gas/i386/property-1.d: Adjust for new output format
    	from readelf.
    	* testsuite/gas/i386/property-2.d: Likewise.
    	* testsuite/gas/i386/x86-64-property-1.d: Likewise.
    	* testsuite/gas/i386/x86-64-property-2.d: Likewise.
Comment 2 Nick Clifton 2019-08-08 16:10:38 UTC
Hi Fangrui,

  Thanks for the suggestion.  I have applied your suggested change,
  and updated 152 test cases to account for the change in the output
  format!

Cheers
  Nick
Comment 3 Sourceware Commits 2019-09-09 16:23:00 UTC
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6715fe29ffcdbef026908fed62e993b238d04d77

commit 6715fe29ffcdbef026908fed62e993b238d04d77
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Sep 9 09:21:36 2019 -0700

    i386: Adjust for new output format from readelf
    
    	PR binutils/24887
    	* testsuite/ld-i386/property-1.r: Adjust for new output format
    	from readelf.
    	* testsuite/ld-i386/property-1a.r: Likewise.
    	* testsuite/ld-i386/property-2.r: Likewise.
    	* testsuite/ld-i386/property-2a.r: Likewise.
    	* testsuite/ld-i386/property-3.r: Likewise.
    	* testsuite/ld-i386/property-3a.r: Likewise.
    	* testsuite/ld-i386/property-4.r: Likewise.
    	* testsuite/ld-i386/property-4a.r: Likewise.
    	* testsuite/ld-i386/property-5.r: Likewise.
    	* testsuite/ld-i386/property-5a.r: Likewise.
    	* testsuite/ld-i386/property-6.r: Likewise.
    	* testsuite/ld-i386/property-7.r: Likewise.
    	* testsuite/ld-i386/property-7a.r: Likewise.
    	* testsuite/ld-i386/property-1.r: Likewise.
    	* testsuite/ld-i386/property-1a.r: Likewise.
    	* testsuite/ld-i386/property-2.r: Likewise.
    	* testsuite/ld-i386/property-2a.r: Likewise.
    	* testsuite/ld-i386/property-3.r: Likewise.
    	* testsuite/ld-i386/property-3a.r: Likewise.
    	* testsuite/ld-i386/property-4.r: Likewise.
    	* testsuite/ld-i386/property-4a.r: Likewise.
    	* testsuite/ld-i386/property-5.r: Likewise.
    	* testsuite/ld-i386/property-5a.r: Likewise.
    	* testsuite/ld-i386/property-6.r: Likewise.
    	* testsuite/ld-i386/property-7.r: Likewise.
    	* testsuite/ld-i386/property-7a.r: Likewise.
Comment 4 Sourceware Commits 2019-09-18 18:20:23 UTC
The binutils-2_33-branch branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=758440d41b189a77161e17e3ef70316ddb4301bf

commit 758440d41b189a77161e17e3ef70316ddb4301bf
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Sep 9 09:21:36 2019 -0700

    i386: Adjust for new output format from readelf
    
    	PR binutils/24887
    	* testsuite/ld-i386/property-1.r: Adjust for new output format
    	from readelf.
    	* testsuite/ld-i386/property-1a.r: Likewise.
    	* testsuite/ld-i386/property-2.r: Likewise.
    	* testsuite/ld-i386/property-2a.r: Likewise.
    	* testsuite/ld-i386/property-3.r: Likewise.
    	* testsuite/ld-i386/property-3a.r: Likewise.
    	* testsuite/ld-i386/property-4.r: Likewise.
    	* testsuite/ld-i386/property-4a.r: Likewise.
    	* testsuite/ld-i386/property-5.r: Likewise.
    	* testsuite/ld-i386/property-5a.r: Likewise.
    	* testsuite/ld-i386/property-6.r: Likewise.
    	* testsuite/ld-i386/property-7.r: Likewise.
    	* testsuite/ld-i386/property-7a.r: Likewise.
    	* testsuite/ld-i386/property-1.r: Likewise.
    	* testsuite/ld-i386/property-1a.r: Likewise.
    	* testsuite/ld-i386/property-2.r: Likewise.
    	* testsuite/ld-i386/property-2a.r: Likewise.
    	* testsuite/ld-i386/property-3.r: Likewise.
    	* testsuite/ld-i386/property-3a.r: Likewise.
    	* testsuite/ld-i386/property-4.r: Likewise.
    	* testsuite/ld-i386/property-4a.r: Likewise.
    	* testsuite/ld-i386/property-5.r: Likewise.
    	* testsuite/ld-i386/property-5a.r: Likewise.
    	* testsuite/ld-i386/property-6.r: Likewise.
    	* testsuite/ld-i386/property-7.r: Likewise.
    	* testsuite/ld-i386/property-7a.r: Likewise.
    
    (cherry picked from commit 6715fe29ffcdbef026908fed62e993b238d04d77)