summaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2018-11-06 12:01:25 +0100
committerMark Wielaard <mark@klomp.org>2018-11-09 17:53:18 +0100
commit4b0342b85b5b1a3d3636e06e3b5320954828dfb1 (patch)
tree77abccb9302380288974cda14832f2b70e5637a9 /backends
parent825e48c4e942e3cbdab1b75c04b8c014867d66ab (diff)
downloadelfutils-4b0342b85b5b1a3d3636e06e3b5320954828dfb1.tar.gz
backends: Add x86_64 section_type_name for SHT_X86_64_UNWIND.
Makes sure that eu-readelf and eu-elflint recognize and show the x86_64 specific section type correctly. Signed-off-by: Mark Wielaard <mark@klomp.org> Tested-by: Milian Wolff <milian.wolff@kdab.com>
Diffstat (limited to 'backends')
-rw-r--r--backends/ChangeLog5
-rw-r--r--backends/x86_64_init.c3
-rw-r--r--backends/x86_64_symbol.c14
3 files changed, 20 insertions, 2 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog
index 768c270b..e2a02812 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,8 @@
+2018-11-06 Mark Wielaard <mark@klomp.org>
+
+ * x86_64_symbol.c (x86_64_section_type_name): New function.
+ * x86_64_init.c (x86_64_int): Hook section_type_name.
+
2018-10-20 Mark Wielaard <mark@klomp.org>
* ppc_initreg.c (ppc_set_initial_registers_tid): Use define instead of
diff --git a/backends/x86_64_init.c b/backends/x86_64_init.c
index adfa4791..49f6c6c7 100644
--- a/backends/x86_64_init.c
+++ b/backends/x86_64_init.c
@@ -1,5 +1,5 @@
/* Initialization of x86-64 specific backend library.
- Copyright (C) 2002-2009, 2013 Red Hat, Inc.
+ Copyright (C) 2002-2009, 2013, 2018 Red Hat, Inc.
Copyright (C) H.J. Lu <hjl.tools@gmail.com>, 2015.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -55,6 +55,7 @@ x86_64_init (Elf *elf __attribute__ ((unused)),
eh->name = "AMD x86-64";
x86_64_init_reloc (eh);
HOOK (eh, reloc_simple_type);
+ HOOK (eh, section_type_name);
if (eh->class == ELFCLASS32)
eh->core_note = x32_core_note;
else
diff --git a/backends/x86_64_symbol.c b/backends/x86_64_symbol.c
index e07b1806..98457bcb 100644
--- a/backends/x86_64_symbol.c
+++ b/backends/x86_64_symbol.c
@@ -1,5 +1,5 @@
/* x86_64 specific symbolic name handling.
- Copyright (C) 2002, 2005 Red Hat, Inc.
+ Copyright (C) 2002, 2005, 2018 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -59,3 +59,15 @@ x86_64_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type,
return ELF_T_NUM;
}
}
+
+/* Return symbolic representation of section type. */
+const char *
+x86_64_section_type_name (int type,
+ char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
+{
+ if (type == SHT_X86_64_UNWIND)
+ return "X86_64_UNWIND";
+
+ return NULL;
+}