aarch64: remove unnecessary loc_hash_table traversal

Message ID f1bffc26-e69f-03bd-bf16-0b2aac3494c8@arm.com
State New
Headers show
Series
  • aarch64: remove unnecessary loc_hash_table traversal
Related show

Commit Message

Szabolcs Nagy June 11, 2019, 9:57 a.m.
The loc_hash_table should only contain local ifunc symbols. The current
code already aborts if there is anything else and for defined ifunc
symbols elfNN_aarch64_allocate_dynrelocs is a no-op.

bfd/ChangeLog:

2019-06-11  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* elfnn-aarch64.c (elfNN_aarch64_allocate_local_dynrelocs): Remove.
	(elfNN_aarch64_size_dynamic_sections): Remove loc_hash_table traversal
	with elfNN_aarch64_allocate_local_dynrelocs.

Comments

Tamar Christina June 14, 2019, 11:15 a.m. | #1
Hi Szabolcs,

The patch also looks OK to me but I'm not a maintainer so you still require approval to commit.

Cheers,
Tamar

> -----Original Message-----

> From: binutils-owner@sourceware.org <binutils-owner@sourceware.org>

> On Behalf Of Szabolcs Nagy

> Sent: Tuesday, June 11, 2019 10:57

> To: Binutils <binutils@sourceware.org>

> Cc: nd <nd@arm.com>

> Subject: [PATCH] aarch64: remove unnecessary loc_hash_table traversal

> 

> The loc_hash_table should only contain local ifunc symbols. The current code

> already aborts if there is anything else and for defined ifunc symbols

> elfNN_aarch64_allocate_dynrelocs is a no-op.

> 

> bfd/ChangeLog:

> 

> 2019-06-11  Szabolcs Nagy  <szabolcs.nagy@arm.com>

> 

> 	* elfnn-aarch64.c (elfNN_aarch64_allocate_local_dynrelocs):

> Remove.

> 	(elfNN_aarch64_size_dynamic_sections): Remove loc_hash_table

> traversal

> 	with elfNN_aarch64_allocate_local_dynrelocs.
Nick Clifton June 14, 2019, 2:44 p.m. | #2
Hi Szabolcs,

> bfd/ChangeLog:

> 2019-06-11  Szabolcs Nagy  <szabolcs.nagy@arm.com>

> 

> 	* elfnn-aarch64.c (elfNN_aarch64_allocate_local_dynrelocs): Remove.

> 	(elfNN_aarch64_size_dynamic_sections): Remove loc_hash_table traversal

> 	with elfNN_aarch64_allocate_local_dynrelocs.


Approved - please apply.

Cheers
  Nick

Patch

diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 761e6b92b5..4bbb151b2a 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -8854,25 +8854,6 @@  elfNN_aarch64_allocate_ifunc_dynrelocs (struct elf_link_hash_entry *h,
   return TRUE;
 }
 
-/* Allocate space in .plt, .got and associated reloc sections for
-   local dynamic relocs.  */
-
-static bfd_boolean
-elfNN_aarch64_allocate_local_dynrelocs (void **slot, void *inf)
-{
-  struct elf_link_hash_entry *h
-    = (struct elf_link_hash_entry *) *slot;
-
-  if (h->type != STT_GNU_IFUNC
-      || !h->def_regular
-      || !h->ref_regular
-      || !h->forced_local
-      || h->root.type != bfd_link_hash_defined)
-    abort ();
-
-  return elfNN_aarch64_allocate_dynrelocs (h, inf);
-}
-
 /* Allocate space in .plt, .got and associated reloc sections for
    local ifunc dynamic relocs.  */
 
@@ -9060,11 +9041,6 @@  elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
   elf_link_hash_traverse (&htab->root, elfNN_aarch64_allocate_ifunc_dynrelocs,
 			  info);
 
-  /* Allocate .plt and .got entries, and space for local symbols.  */
-  htab_traverse (htab->loc_hash_table,
-		 elfNN_aarch64_allocate_local_dynrelocs,
-		 info);
-
   /* Allocate .plt and .got entries, and space for local ifunc symbols.  */
   htab_traverse (htab->loc_hash_table,
 		 elfNN_aarch64_allocate_local_ifunc_dynrelocs,