]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - bfd/ChangeLog
PowerPC64: Downgrade ifunc with textrel error to a warning
authorAlan Modra <amodra@gmail.com>
Tue, 9 Jun 2020 00:02:10 +0000 (09:32 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 9 Jun 2020 00:07:23 +0000 (09:37 +0930)
commitefb2a7b412c2c78eaf6d3b63f153a749fcde292c
tree9520362ef89c24e92b7c7a545778f700065aef45
parentc3cd66019e6ce9234909ea18331049eda56d76c2
PowerPC64: Downgrade ifunc with textrel error to a warning

For ppc64 I set flags when recording the dynamic relocation rather
than when allocating space.  That allows you to distinguish three
cases:
1) The dynamic ifunc relocation is in an executable and will always be
   to an ifunc resolver in the executable.
2) The dynamic ifunc relocation is in a shared library which provides
   an ifunc resolver, but that may be overridden at runtime to use a
   resolver in another binary.
3) The dynamic ifunc relocation is not to a locally defined ifunc
   resolver.

Case (3) won't cause a segfault trying to run resolver code that is
non-exec on older glibc.

I made case (1) an error for ppc64, but since newer glibc ld.so does
allow running ifunc resolvers when segments are writable I suppose I
should downgrade that to a warning like case (2).

* elf64-ppc.c (struct ppc_link_hash_table): Delete
maybe_local_ifunc_resolver field.
(build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
cases where maybe_local_ifunc_resolver was set.
(ppc64_elf_relocate_section): Likewise.
(ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
error to a warning.
bfd/ChangeLog
bfd/elf64-ppc.c