diff options
author | Mark Wielaard <mark@klomp.org> | 2020-11-17 15:08:05 +0100 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2020-11-17 15:09:57 +0100 |
commit | 00a25cf38d56bacae6b82c79cf226c22d12295a5 (patch) | |
tree | 68f5125110ab3069641c0819e7db8eccbdd48ff4 /backends | |
parent | d89111fb0ed471197f83ef380351c86984fe0529 (diff) | |
download | elfutils-00a25cf38d56bacae6b82c79cf226c22d12295a5.tar.gz |
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 <mark@klomp.org>
Diffstat (limited to 'backends')
-rw-r--r-- | backends/ChangeLog | 5 | ||||
-rw-r--r-- | backends/x86_64_init.c | 1 | ||||
-rw-r--r-- | backends/x86_64_symbol.c | 8 |
3 files changed, 14 insertions, 0 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog index 81d4127c..e88dedf9 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -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. diff --git a/backends/x86_64_init.c b/backends/x86_64_init.c index 8db9b643..be965fa6 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 98457bcb..d5f62e8f 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; +} |