This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Add missing newlines in readelf -n output
- From: Andreas Schwab <schwab at suse dot de>
- To: binutils at sourceware dot org
- Date: Tue, 11 Jul 2017 17:41:00 +0200
- Subject: [PATCH] Add missing newlines in readelf -n output
- Authentication-results: sourceware.org; auth=none
This fixes some formatting glitches in the output of readline -n.
Committed as obvious.
Andreas.
* readelf.c (process_note): Print newline after description data
in narrow mode.
(print_core_note): Print newline if nothing was printed in wide
mode.
---
binutils/ChangeLog | 7 +++++++
binutils/readelf.c | 8 +++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 8c12a495c5..254be5e59c 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,10 @@
+2017-07-11 Andreas Schwab <schwab@suse.de>
+
+ * readelf.c (process_note): Print newline after description data
+ in narrow mode.
+ (print_core_note): Print newline if nothing was printed in wide
+ mode.
+
2017-07-09 Rafael Fontenelle <rafaelff@gnome.org>
* dwarf.c (display_formatted_table): Fix error message typo.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index c9c11a3993..362c204bcb 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -16217,7 +16217,11 @@ print_core_note (Elf_Internal_Note *pnote)
unsigned char *descdata, *filenames, *descend;
if (pnote->type != NT_FILE)
- return TRUE;
+ {
+ if (do_wide)
+ printf ("\n");
+ return TRUE;
+ }
#ifndef BFD64
if (!is_32bit_elf)
@@ -17497,6 +17501,8 @@ process_note (Elf_Internal_Note * pnote,
printf (_(" description data: "));
for (i = 0; i < pnote->descsz; i++)
printf ("%02x ", pnote->descdata[i]);
+ if (!do_wide)
+ printf ("\n");
}
if (do_wide)
--
2.13.2
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."