Hello,

I just discovered a display issue in readelf, which affects only 64-bit ELFs. I was about to check info in the dynamic section, and I saw the header line is a bit off. In the source code I found the answer: it was hard-coded for 32-bit ELFs. So here is my patch -- perhaps not perfect, but solves the issue.

Aron

>From 5afd89acf252e796f34538d8a71622652ae2b90d Mon Sep 17 00:00:00 2001
From: Aron Barath <baratha...@caesar.elte.hu>
Date: Thu, 11 Jan 2018 09:26:27 +0100
Subject: [PATCH] display of the Dynamic section of 64-bit ELFs was a bit off

---
 binutils/readelf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/binutils/readelf.c b/binutils/readelf.c
index ae1cda9a7b..ea5151f84f 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -9728,7 +9728,12 @@ process_dynamic_section (Filedata * filedata)
 		      dynamic_nent),
 	    dynamic_addr, (unsigned long) dynamic_nent);
   if (do_dynamic)
-    printf (_("  Tag        Type                         Name/Value\n"));
+    {
+      if (is_32bit_elf)
+        printf (_("  Tag        Type                         Name/Value\n"));
+      else
+        printf (_("  Tag                Type                         Name/Value\n"));
+    }
 
   for (entry = dynamic_section;
        entry < dynamic_section + dynamic_nent;
-- 
2.15.1

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to