aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-02-17 15:31:54 +0000
committerNick Clifton <nickc@redhat.com>2017-02-17 15:31:54 +0000
commit1b4b80bf3771dfb886687a61c541d12bfa1f1f51 (patch)
tree2ea179fb07e7daa4442e60d9c73d748f21b026a7 /binutils
parent6438d1be9e9b6802a465c70c76b9cec7e23270f3 (diff)
downloadfsf-binutils-gdb-1b4b80bf3771dfb886687a61c541d12bfa1f1f51.zip
fsf-binutils-gdb-1b4b80bf3771dfb886687a61c541d12bfa1f1f51.tar.gz
fsf-binutils-gdb-1b4b80bf3771dfb886687a61c541d12bfa1f1f51.tar.bz2
Add support to readelf for displaying GNU section types.
* readelf.c (get_section_type_name): Add decoding of GNU section types.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/readelf.c13
2 files changed, 17 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 55acd8c..07c7aa9 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -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
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;
}