From c0d78d9062c1f60ad10a622796d54e03aea26f9c Mon Sep 17 00:00:00 2001 From: Seth LaForge Date: Wed, 2 Dec 2015 20:33:45 -0800 Subject: [PATCH] Minor changes to readelf formatting. This makes the output more similar to GNU readelf. It's not identical - in particular there are still a lot of whitespace differences - but at least gets you within striking distance of no changes when comparing with "diff -w". --- scripts/readelf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/readelf.py b/scripts/readelf.py index f307e95..43cb37b 100755 --- a/scripts/readelf.py +++ b/scripts/readelf.py @@ -873,7 +873,7 @@ class ReadElf(object): # Unknown attribute values are passed-through as integers if isinstance(name, int): name = 'Unknown AT value: %x' % name - self._emitline(' <%2x> %-18s: %s' % ( + self._emitline(' <%x> %-18s: %s' % ( attr.offset, name, describe_attr_value( @@ -1057,7 +1057,7 @@ class ReadElf(object): def _emitline(self, s=''): """ Emit an object to output, followed by a newline """ - self.output.write(str(s) + '\n') + self.output.write(str(s).rstrip() + '\n') SCRIPT_DESCRIPTION = 'Display information about the contents of ELF format files' -- 2.30.2