From: Mark Wielaard Date: Tue, 17 Nov 2020 14:08:05 +0000 (+0100) Subject: backends: Handle SHT_X86_64_UNWIND as valid relocation target type. X-Git-Tag: elfutils-0.183~93 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=00a25cf38d56bacae6b82c79cf226c22d12295a5;p=thirdparty%2Felfutils.git backends: Handle SHT_X86_64_UNWIND as valid relocation target type. The x86_64 abi defines a special section type for .eh_frame[_hdr], SHT_X86_64_UNWIND, which is a valid relocation target type. https://sourceware.org/bugzilla/show_bug.cgi?id=26878 Signed-off-by: Mark Wielaard --- diff --git a/backends/ChangeLog b/backends/ChangeLog index 81d4127c0..e88dedf93 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,8 @@ +2020-11-17 Mark Wielard + + * x86_64_symbol.c (x86_64_check_reloc_target_type): New function. + * x86_64_init.c (x86_64_init): Hook check_reloc_target_type. + 2020-10-19 Mark Wielard * Makefile.am (modules): Remove tilegx. diff --git a/backends/x86_64_init.c b/backends/x86_64_init.c index 8db9b6438..be965fa6b 100644 --- a/backends/x86_64_init.c +++ b/backends/x86_64_init.c @@ -63,6 +63,7 @@ x86_64_init (Elf *elf __attribute__ ((unused)), eh->frame_nregs = 17; HOOK (eh, set_initial_registers_tid); HOOK (eh, unwind); + HOOK (eh, check_reloc_target_type); return eh; } diff --git a/backends/x86_64_symbol.c b/backends/x86_64_symbol.c index 98457bcb8..d5f62e8f7 100644 --- a/backends/x86_64_symbol.c +++ b/backends/x86_64_symbol.c @@ -71,3 +71,11 @@ x86_64_section_type_name (int type, return NULL; } + +/* The SHT_X86_64_UNWIND section type is a valid target for relocation. */ +bool +x86_64_check_reloc_target_type (Ebl *ebl __attribute__ ((unused)), + Elf64_Word sh_type) +{ + return sh_type == SHT_X86_64_UNWIND; +}