From 79b0c981b8f0c912208ec305d48e775bcb6d2624 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 3 Nov 2017 11:14:56 -0700 Subject: x86: Remove func_pointer_refcount Since check_reloc is running after gc_sections, there is no need for reference count. If a function pointer relocation can be resolved at run-time, there is no need for PLT and it doesn't count as non-GOT/PLT relocation. func_pointer_refcount can be removed. * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1. Don't use func_pointer_refcount. Don't set plt.refcount nor non_got_ref for function pointer reference. * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use func_pointer_refcount. (_bfd_x86_elf_copy_indirect_symbol): Don't copy func_pointer_refcount. (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount. * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise. (elf_x86_link_hash_entry): Remove func_pointer_refcount. --- bfd/elfxx-x86.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'bfd/elfxx-x86.h') diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h index 8d2a731..fb57d43 100644 --- a/bfd/elfxx-x86.h +++ b/bfd/elfxx-x86.h @@ -133,7 +133,6 @@ && (EH) != NULL \ && (EH)->elf.dynindx != -1 \ && (!(EH)->elf.non_got_ref \ - || (EH)->func_pointer_refcount > 0 \ || ((EH)->elf.root.type == bfd_link_hash_undefweak \ && !(RESOLVED_TO_ZERO))) \ && (((EH)->elf.def_dynamic && !(EH)->elf.def_regular) \ @@ -268,10 +267,6 @@ struct elf_x86_link_hash_entry is only used by x86-64. */ unsigned int needs_copy : 1; - /* Reference count of C/C++ function pointer relocations in read-write - section which can be resolved at run-time. */ - bfd_signed_vma func_pointer_refcount; - /* Information about the GOT PLT entry. Filled when there are both GOT and PLT relocations against the same function. */ union gotplt_union plt_got; -- cgit v1.1