Add support to readelf for displaying GNU section types.
authorNick Clifton <nickc@redhat.com>
Fri, 17 Feb 2017 15:31:54 +0000 (15:31 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 17 Feb 2017 15:31:54 +0000 (15:31 +0000)
* readelf.c (get_section_type_name): Add decoding of GNU section
types.

binutils/ChangeLog
binutils/readelf.c

index 55acd8c256b989bf17bac39116532645223d7f98..07c7aa964e811ac4593b295ebf7e81d6123f4718 100644 (file)
@@ -1,3 +1,8 @@
+2017-02-17  Nick Clifton  <nickc@redhat.com>
+
+       * readelf.c (get_section_type_name): Add decoding of GNU section
+       types.
+
 2017-02-15  Nick Clifton  <nickc@redhat.com>
 
        * MAINTAINERS: (MIPS, MN10300): Move Eric Christopher to Past
index 150b68025be11c589a1332014b4309a97ae6eb1d..ea9da7afb799d18ef7535149c6620e0d457386ff 100644 (file)
@@ -4136,7 +4136,18 @@ get_section_type_name (unsigned int sh_type)
              if (elf_header.e_ident[EI_OSABI] == ELFOSABI_SOLARIS)
                result = get_solaris_section_type (sh_type);
              else
-               result = NULL;
+               {
+                 switch (sh_type)
+                   {
+                   case SHT_GNU_INCREMENTAL_INPUTS: result = "GNU_INCREMENTAL_INPUTS"; break;
+                   case SHT_GNU_ATTRIBUTES: result = "GNU_ATTRIBUTES"; break;
+                   case SHT_GNU_HASH: result = "GNU_HASH"; break;
+                   case SHT_GNU_LIBLIST: result = "GNU_LIBLIST"; break;
+                   default:
+                     result = NULL;
+                     break;
+                   }
+               }
              break;
            }