This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] aarch64: simplify the DT_AARCH64_VARIANT_PCS handling code


On 09/07/2019 13:55, Szabolcs Nagy wrote:
> Remove unnecessary variant_pcs field: the dynamic tag can be checked
> directly.
> 
> I'll commit this tomorrow unless there are comments.
> Then backport it with the variant pcs support to release branches
> https://sourceware.org/ml/libc-alpha/2019-05/msg00523.html
> 
> 2019-07-09  Szabolcs Nagy  <szabolcs.nagy@arm.com>
> 
> 	* sysdeps/aarch64/dl-machine.h (elf_machine_runtime_setup): Remove the
> 	DT_AARCH64_VARIANT_PCS check.
> 	(elf_machine_lazy_rel): Use l_info[DT_AARCH64 (VARIANT_PCS)].
> 	* sysdeps/aarch64/linkmap.h (struct link_map_machine): Remove
> 	variant_pcs.
> 

and now with the patch attached.

diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h
index 4f27637b20..9b2e0ffdbf 100644
--- a/sysdeps/aarch64/dl-machine.h
+++ b/sysdeps/aarch64/dl-machine.h
@@ -105,10 +105,6 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 	}
     }
 
-  /* Check if STO_AARCH64_VARIANT_PCS needs to be handled.  */
-  if (l->l_info[DT_AARCH64 (VARIANT_PCS)])
-    l->l_mach.variant_pcs = 1;
-
   return lazy;
 }
 
@@ -402,7 +398,7 @@ elf_machine_lazy_rel (struct link_map *map,
 	  return;
 	}
 
-      if (__glibc_unlikely (map->l_mach.variant_pcs))
+      if (__glibc_unlikely (map->l_info[DT_AARCH64 (VARIANT_PCS)] != NULL))
 	{
 	  /* Check the symbol table for variant PCS symbols.  */
 	  const Elf_Symndx symndx = ELFW (R_SYM) (reloc->r_info);
diff --git a/sysdeps/aarch64/linkmap.h b/sysdeps/aarch64/linkmap.h
index 7f801b14db..ba74fe10e1 100644
--- a/sysdeps/aarch64/linkmap.h
+++ b/sysdeps/aarch64/linkmap.h
@@ -20,5 +20,4 @@ struct link_map_machine
 {
   ElfW(Addr) plt;	  /* Address of .plt */
   void *tlsdesc_table;	  /* Address of TLS descriptor hash table.  */
-  int variant_pcs;	  /* If set, PLT calls may follow a variant PCS.  */
 };

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]