backends: Add x86_64 section_type_name for SHT_X86_64_UNWIND.
authorMark Wielaard <mark@klomp.org>
Tue, 6 Nov 2018 11:01:25 +0000 (12:01 +0100)
committerMark Wielaard <mark@klomp.org>
Fri, 9 Nov 2018 16:53:18 +0000 (17:53 +0100)
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>
backends/ChangeLog
backends/x86_64_init.c
backends/x86_64_symbol.c

index 768c270..e2a0281 100644 (file)
@@ -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
index adfa479..49f6c6c 100644 (file)
@@ -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
index e07b180..98457bc 100644 (file)
@@ -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;
+}