git: 847dfd2803f6 - main - readelf: do not trucate section name with -W

Ed Maste emaste at FreeBSD.org
Wed Feb 3 21:25:11 UTC 2021


The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=847dfd2803f6c8b077e3ebc68e35adff2c79a65f

commit 847dfd2803f6c8b077e3ebc68e35adff2c79a65f
Author:     Ed Maste <emaste at FreeBSD.org>
AuthorDate: 2021-02-02 14:35:04 +0000
Commit:     Ed Maste <emaste at FreeBSD.org>
CommitDate: 2021-02-03 21:24:22 +0000

    readelf: do not trucate section name with -W
    
    PR:             246015
    Reviewed by:    cem
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D28461
---
 contrib/elftoolchain/readelf/readelf.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c
index 479f4a5ba28f..022c9e9066ab 100644
--- a/contrib/elftoolchain/readelf/readelf.c
+++ b/contrib/elftoolchain/readelf/readelf.c
@@ -2632,16 +2632,21 @@ dump_shdr(struct readelf *re)
 				    " %6.6jx %6.6jx %2.2jx  %2u %3u %2ju\n"
 				    "       %s\n", ST_CT);
 			else
-				printf("  [%2d] %-17.17s %-15.15s %8.8jx"
-				    " %6.6jx %6.6jx %2.2jx %3s %2u %3u %2ju\n",
-				    S_CT);
+				if (re->options & RE_WW)
+					printf("  [%2d] %-17s %-15.15s "
+					    "%8.8jx %6.6jx %6.6jx %2.2jx %3s "
+					    "%2u %3u %2ju\n", S_CT);
+				else
+					printf("  [%2d] %-17.17s %-15.15s "
+					    "%8.8jx %6.6jx %6.6jx %2.2jx %3s "
+					    "%2u %3u %2ju\n", S_CT);
 		} else if (re->options & RE_WW) {
 			if (re->options & RE_T)
 				printf("  [%2d] %s\n       %-15.15s %16.16jx"
 				    " %6.6jx %6.6jx %2.2jx  %2u %3u %2ju\n"
 				    "       %s\n", ST_CT);
 			else
-				printf("  [%2d] %-17.17s %-15.15s %16.16jx"
+				printf("  [%2d] %-17s %-15.15s %16.16jx"
 				    " %6.6jx %6.6jx %2.2jx %3s %2u %3u %2ju\n",
 				    S_CT);
 		} else {


More information about the dev-commits-src-all mailing list