From c94053440e29421dd8846530da73f09c9ede2e0f Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 23 Sep 2020 14:55:39 +0930 Subject: PR26655, Power10 libstdc++.so R_PPC64_NONE dynamic relocs Some of the powerpc64 code editing functions are better run after dynamic symbols have stabilised in order to make proper decisions based on SYMBOL_REFERENCES_LOCAL. The dynamic symbols are processed early in bfd_elf_size_dynamic_sections, before the backend always_size_sections function is called. One function, ppc64_elf_tls_setup must run before bfd_elf_size_dynamic_sections because it changes dynamic symbols. ppc64_elf_edit_opd and ppc64_elf_inline_plt can run early or late, I think. ppc64_elf_tls_optimize and ppc64_elf_edit_toc are better run later. So this patch arranges to call some edit functions later via always_size_sections. PR 26655 bfd/ * elf64-ppc.c (ppc64_elf_func_desc_adjust): Rename to.. (ppc64_elf_edit): Call params->edit. (ppc64_elf_tls_setup): Don't call _bfd_elf_tls_setup. Return a bfd_boolean. * elf64-ppc.h (struct ppc64_elf_params): Add "edit". (ppc64_elf_tls_setup): Update declaration. ld/ * emultempl/ppc64elf.em (params): Add ppc_edit. (ppc_before_allocation): Split off some edit functions to.. (ppc_edit): ..this, new function. --- bfd/elf64-ppc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bfd/elf64-ppc.h') diff --git a/bfd/elf64-ppc.h b/bfd/elf64-ppc.h index a7230de..0492fd7 100644 --- a/bfd/elf64-ppc.h +++ b/bfd/elf64-ppc.h @@ -27,6 +27,7 @@ struct ppc64_elf_params /* Linker call-backs. */ asection * (*add_stub_section) (const char *, asection *); void (*layout_sections_again) (void); + void (*edit) (void); /* Maximum size of a group of input sections that can be handled by one stub section. A value of +/-1 indicates the bfd back-end @@ -80,7 +81,7 @@ bfd_boolean ppc64_elf_edit_opd (struct bfd_link_info *); bfd_boolean ppc64_elf_inline_plt (struct bfd_link_info *); -asection *ppc64_elf_tls_setup +bfd_boolean ppc64_elf_tls_setup (struct bfd_link_info *); bfd_boolean ppc64_elf_tls_optimize (struct bfd_link_info *); -- cgit v1.1