From 4b0342b85b5b1a3d3636e06e3b5320954828dfb1 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 6 Nov 2018 12:01:25 +0100 Subject: [PATCH] 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 Tested-by: Milian Wolff --- backends/ChangeLog | 5 +++++ backends/x86_64_init.c | 3 ++- backends/x86_64_symbol.c | 14 +++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/backends/ChangeLog b/backends/ChangeLog index 768c270..e2a0281 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,8 @@ +2018-11-06 Mark Wielaard + + * 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 * 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 adfa479..49f6c6c 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 , 2015. This file is part of elfutils. Written by Ulrich Drepper , 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 e07b180..98457bc 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 , 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; +} -- 2.7.4