[PATCH v1 15/27] aarch64: rename gnu_and_prop to gnu_property_aarch64_feature_1_and

Matthieu Longo matthieu.longo@arm.com
Mon Dec 2 14:22:07 GMT 2024


---
 bfd/elfnn-aarch64.c | 24 ++++++++++++------------
 bfd/elfxx-aarch64.c | 14 +++++++-------
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index ba583494b11..ae7105af2a5 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -2540,7 +2540,7 @@ struct elf_aarch64_obj_tdata
   int no_wchar_size_warning;
 
   /* All GNU_PROPERTY_AARCH64_FEATURE_1_AND properties.  */
-  uint32_t gnu_and_prop;
+  uint32_t gnu_property_aarch64_feature_1_and;
 
   /* Software protections options.  */
   struct aarch64_protection_opts sw_protections;
@@ -3464,8 +3464,8 @@ aarch64_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
 static bool
 elf_aarch64_bti_p (bfd *output_bfd)
 {
-  uint32_t prop = elf_aarch64_tdata (output_bfd)->gnu_and_prop;
-  return prop & GNU_PROPERTY_AARCH64_FEATURE_1_BTI;
+  return elf_aarch64_tdata (output_bfd)->gnu_property_aarch64_feature_1_and
+       & GNU_PROPERTY_AARCH64_FEATURE_1_BTI;
 }
 
 /* External entry points for sizing and building linker stubs.  */
@@ -5040,7 +5040,7 @@ bfd_elfNN_aarch64_set_options (struct bfd *output_bfd,
   /* Note: gnu_property_aarch64_feature_1_and was initialized to 0 by
      bfd_zalloc().  */
   if (sw_protections->plt_type & PLT_BTI)
-    elf_aarch64_tdata (output_bfd)->gnu_and_prop
+    elf_aarch64_tdata (output_bfd)->gnu_property_aarch64_feature_1_and
       |= GNU_PROPERTY_AARCH64_FEATURE_1_BTI;
 
   elf_aarch64_tdata (output_bfd)->sw_protections = *sw_protections;
@@ -10616,11 +10616,11 @@ static bfd *
 elfNN_aarch64_link_setup_gnu_properties (struct bfd_link_info *info)
 {
   struct elf_aarch64_obj_tdata * tdata = elf_aarch64_tdata (info->output_bfd);
-  uint32_t prop = tdata->gnu_and_prop;
-  bfd *pbfd = _bfd_aarch64_elf_link_setup_gnu_properties (info, &prop);
-  tdata->gnu_and_prop = prop;
+  uint32_t outprop = tdata->gnu_property_aarch64_feature_1_and;
+  bfd *pbfd = _bfd_aarch64_elf_link_setup_gnu_properties (info, &outprop);
+  tdata->gnu_property_aarch64_feature_1_and = outprop;
   tdata->sw_protections.plt_type
-    |= (prop & GNU_PROPERTY_AARCH64_FEATURE_1_BTI) ? PLT_BTI : 0;
+    |= (outprop & GNU_PROPERTY_AARCH64_FEATURE_1_BTI) ? PLT_BTI : 0;
   setup_plt_values (info, tdata->sw_protections.plt_type);
   return pbfd;
 }
@@ -10634,8 +10634,8 @@ elfNN_aarch64_merge_gnu_properties (struct bfd_link_info *info,
 				       elf_property *aprop,
 				       elf_property *bprop)
 {
-  uint32_t prop
-    = elf_aarch64_tdata (info->output_bfd)->gnu_and_prop;
+  uint32_t outprop
+    = elf_aarch64_tdata (info->output_bfd)->gnu_property_aarch64_feature_1_and;
 
   /* Properties are merged per type, hence only check for warnings when merging
      GNU_PROPERTY_AARCH64_FEATURE_1_AND.  */
@@ -10648,7 +10648,7 @@ elfNN_aarch64_merge_gnu_properties (struct bfd_link_info *info,
 
       /* If output has been marked with BTI using command line argument, give
 	 out warning if necessary.  */
-      if ((prop & GNU_PROPERTY_AARCH64_FEATURE_1_BTI)
+      if ((outprop & GNU_PROPERTY_AARCH64_FEATURE_1_BTI)
 	  && (bti_report != MARKING_NONE))
 	{
 	  if (!aprop || !(aprop->u.number & GNU_PROPERTY_AARCH64_FEATURE_1_BTI))
@@ -10659,7 +10659,7 @@ elfNN_aarch64_merge_gnu_properties (struct bfd_link_info *info,
     }
 
   return  _bfd_aarch64_elf_merge_gnu_properties (info, abfd, aprop,
-						 bprop, prop);
+						 bprop, outprop);
 }
 
 /* We use this so we can override certain functions
diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c
index 45a246a600b..2c0afb5a21d 100644
--- a/bfd/elfxx-aarch64.c
+++ b/bfd/elfxx-aarch64.c
@@ -710,7 +710,7 @@ _bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info,
   elf_property *prop;
   unsigned align;
 
-  uint32_t gnu_prop = *gprop;
+  uint32_t outprop = *gprop;
 
   /* Find a normal input file with GNU property note.  */
   for (pbfd = info->input_bfds;
@@ -728,17 +728,17 @@ _bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info,
   /* If ebfd != NULL it is either an input with property note or the last
      input.  Either way if we have gnu_prop, we should add it (by creating
      a section if needed).  */
-  if (ebfd != NULL && gnu_prop)
+  if (ebfd != NULL && outprop)
     {
       prop = _bfd_elf_get_property (ebfd,
 				    GNU_PROPERTY_AARCH64_FEATURE_1_AND,
 				    4);
-      if (gnu_prop & GNU_PROPERTY_AARCH64_FEATURE_1_BTI
+      if (outprop & GNU_PROPERTY_AARCH64_FEATURE_1_BTI
 	  && !(prop->u.number & GNU_PROPERTY_AARCH64_FEATURE_1_BTI))
 	    _bfd_error_handler (_("%pB: warning: BTI turned on by -z force-bti "
 				  "when all inputs do not have BTI in NOTE "
 				  "section."), ebfd);
-      prop->u.number |= gnu_prop;
+      prop->u.number |= outprop;
       prop->pr_kind = property_number;
 
       /* pbfd being NULL implies ebfd is the last input.  Create the GNU
@@ -772,7 +772,7 @@ _bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info,
     return pbfd;
 
   /* If pbfd has any GNU_PROPERTY_AARCH64_FEATURE_1_AND properties, update
-     gnu_prop accordingly.  */
+     outprop accordingly.  */
   if (pbfd != NULL)
     {
       elf_property_list *p;
@@ -783,7 +783,7 @@ _bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info,
 	  /* Check for all GNU_PROPERTY_AARCH64_FEATURE_1_AND.  */
 	  if (GNU_PROPERTY_AARCH64_FEATURE_1_AND == p->property.pr_type)
 	    {
-	      gnu_prop = (p->property.u.number
+	      outprop = (p->property.u.number
 			  & (GNU_PROPERTY_AARCH64_FEATURE_1_PAC
 			      | GNU_PROPERTY_AARCH64_FEATURE_1_BTI));
 	      break;
@@ -792,7 +792,7 @@ _bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info,
 	    break;
 	}
     }
-  *gprop = gnu_prop;
+  *gprop = outprop;
   return pbfd;
 }
 
-- 
2.47.0



More information about the Binutils mailing list