public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Commit: Add decoding of GNU section types to readelf
@ 2017-02-17 15:30 Nick Clifton
  0 siblings, 0 replies; only message in thread
From: Nick Clifton @ 2017-02-17 15:30 UTC (permalink / raw)
  To: binutils

Hi Guys,

  I am checking in the patch below to add decoding the various GNU
  specific section types to readelf.

Cheers
  Nick

binutils/ChangeLog
2017-02-17  Nick Clifton  <nickc@redhat.com>

	* readelf.c (get_section_type_name): Add decoding of GNU section
	types.

diff --git a/binutils/readelf.c b/binutils/readelf.c
index 150b680..ea9da7a 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -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;
            }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-17 15:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-17 15:30 Commit: Add decoding of GNU section types to readelf Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).