From 847dfd2803f6c8b077e3ebc68e35adff2c79a65f Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Tue, 2 Feb 2021 09:35:04 -0500 Subject: [PATCH] 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 {