]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
backends: Handle SHT_X86_64_UNWIND as valid relocation target type.
authorMark Wielaard <mark@klomp.org>
Tue, 17 Nov 2020 14:08:05 +0000 (15:08 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 17 Nov 2020 14:09:57 +0000 (15:09 +0100)
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 <mark@klomp.org>
backends/ChangeLog
backends/x86_64_init.c
backends/x86_64_symbol.c

index 81d4127c0bd1afbba9fc6cd78cb3cc061e4fb3b4..e88dedf939bd2422a7e4ca6caa9b9bda72e90284 100644 (file)
@@ -1,3 +1,8 @@
+2020-11-17  Mark Wielard  <mark@klomp.org>
+
+       * 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  <mark@klomp.org>
 
        * Makefile.am (modules): Remove tilegx.
index 8db9b643852b809b4f9b05d060eb1d5481ebeec5..be965fa6b2b1484eeff1cd33f62a33fea25913d1 100644 (file)
@@ -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;
 }
index 98457bcb8e396d3a8b06138bf66de2cb8c3dac12..d5f62e8f7760f9f37d60b24852fb3055483f710b 100644 (file)
@@ -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;
+}