[patch] Add readelf support for gold version note sections

Cary Coutant ccoutant@google.com
Wed Feb 5 18:31:00 GMT 2014


This patch adds readelf support for dumping gold version note sections.

Tested with no regressions on x86-64. OK to commit?

-cary


2014-02-05  Cary Coutant  <ccoutant@google.com>

binutils/
        PR binutils/16444
        * readelf.c (print_gnu_note): Add support for NT_GNU_GOLD_VERSION.


diff --git a/binutils/readelf.c b/binutils/readelf.c
index 7d228d6..453aeb7 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -13576,6 +13576,17 @@ print_gnu_note (Elf_Internal_Note *pnote)
                major, minor, subminor);
       }
       break;
+
+    case NT_GNU_GOLD_VERSION:
+      {
+       unsigned long i;
+
+       printf (_("    Version: "));
+       for (i = 0; i < pnote->descsz && pnote->descdata[i] != '\0'; ++i)
+         printf ("%c", pnote->descdata[i]);
+       printf ("\n");
+      }
+      break;
     }

   return 1;



More information about the Binutils mailing list