[AArch64] Drop unused argument to elf_aarch64_create_or_find_stub_sec
[deliverable/binutils-gdb.git] / bfd / elfnn-aarch64.c
index 8a66299acb01770bafbb01f279d4bed70b9ccf01..acef708fc6d7c02d8cc12aa8197f81e4315a5f36 100644 (file)
@@ -1847,12 +1847,6 @@ struct elf_aarch64_link_hash_table
   /* Fix erratum 835769.  */
   int fix_erratum_835769;
 
-  /* A table of fix locations for erratum 835769.  This holds erratum
-     fix locations between elfNN_aarch64_size_stubs() and
-     elfNN_aarch64_write_section().  */
-  struct aarch64_erratum_835769_fix *aarch64_erratum_835769_fixes;
-  unsigned int num_aarch64_erratum_835769_fixes;
-
   /* The number of bytes in the initial entry in the PLT.  */
   bfd_size_type plt_header_size;
 
@@ -2445,8 +2439,7 @@ aarch64_build_one_stub (struct bfd_hash_entry *gen_entry,
       template_size = sizeof (aarch64_erratum_835769_stub);
       break;
     default:
-      BFD_FAIL ();
-      return FALSE;
+      abort ();
     }
 
   for (i = 0; i < (template_size / sizeof template[0]); i++)
@@ -2504,7 +2497,7 @@ aarch64_build_one_stub (struct bfd_hash_entry *gen_entry,
       break;
 
     default:
-      break;
+      abort ();
     }
 
   return TRUE;
@@ -2535,9 +2528,7 @@ aarch64_size_one_stub (struct bfd_hash_entry *gen_entry,
       size = sizeof (aarch64_erratum_835769_stub);
       break;
     default:
-      BFD_FAIL ();
-      return FALSE;
-      break;
+      abort ();
     }
 
   size = (size + 7) & ~7;
@@ -2758,12 +2749,19 @@ group_sections (struct elf_aarch64_link_hash_table *htab,
 #define AARCH64_LDST_SIMD_S(insn) (((insn) & 0xbf9f0000) == 0x0d000000)
 #define AARCH64_LDST_SIMD_S_PI(insn) (((insn) & 0xbf800000) == 0x0d800000)
 
-/* Classify an INSN if it is indeed a load/store.  Return TRUE if INSN
-   is a load/store along with the Rt and Rtn.  Return FALSE if not a
-   load/store.  */
+/* Classify an INSN if it is indeed a load/store.
+
+   Return TRUE if INSN is a LD/ST instruction otherwise return FALSE.
+
+   For scalar LD/ST instructions PAIR is FALSE, RT is returned and RT2
+   is set equal to RT.
+
+   For LD/ST pair instructions PAIR is TRUE, RT and RT2 are returned.
+
+ */
 
 static bfd_boolean
-aarch64_mem_op_p (uint32_t insn, unsigned int *rt, unsigned int *rtn,
+aarch64_mem_op_p (uint32_t insn, unsigned int *rt, unsigned int *rt2,
                  bfd_boolean *pair, bfd_boolean *load)
 {
   uint32_t opcode;
@@ -2782,11 +2780,11 @@ aarch64_mem_op_p (uint32_t insn, unsigned int *rt, unsigned int *rtn,
   if (AARCH64_LDST_EX (insn))
     {
       *rt = AARCH64_RT (insn);
-      *rtn = *rt;
+      *rt2 = *rt;
       if (AARCH64_BIT (insn, 21) == 1)
         {
          *pair = TRUE;
-         *rtn = AARCH64_RT2 (insn);
+         *rt2 = AARCH64_RT2 (insn);
        }
       *load = AARCH64_LD (insn);
       return TRUE;
@@ -2798,7 +2796,7 @@ aarch64_mem_op_p (uint32_t insn, unsigned int *rt, unsigned int *rtn,
     {
       *pair = TRUE;
       *rt = AARCH64_RT (insn);
-      *rtn = AARCH64_RT2 (insn);
+      *rt2 = AARCH64_RT2 (insn);
       *load = AARCH64_LD (insn);
       return TRUE;
     }
@@ -2811,7 +2809,7 @@ aarch64_mem_op_p (uint32_t insn, unsigned int *rt, unsigned int *rtn,
           || AARCH64_LDST_UIMM (insn))
    {
       *rt = AARCH64_RT (insn);
-      *rtn = *rt;
+      *rt2 = *rt;
       if (AARCH64_LDST_PCREL (insn))
        *load = TRUE;
       opc = AARCH64_BITS (insn, 22, 2);
@@ -2831,21 +2829,21 @@ aarch64_mem_op_p (uint32_t insn, unsigned int *rt, unsigned int *rtn,
        {
        case 0:
        case 2:
-         *rtn = *rt + 3;
+         *rt2 = *rt + 3;
          break;
 
        case 4:
        case 6:
-         *rtn = *rt + 2;
+         *rt2 = *rt + 2;
          break;
 
        case 7:
-         *rtn = *rt;
+         *rt2 = *rt;
          break;
 
        case 8:
        case 10:
-         *rtn = *rt + 1;
+         *rt2 = *rt + 1;
          break;
 
        default:
@@ -2865,21 +2863,21 @@ aarch64_mem_op_p (uint32_t insn, unsigned int *rt, unsigned int *rtn,
        case 0:
        case 2:
        case 4:
-         *rtn = *rt + r;
+         *rt2 = *rt + r;
          break;
 
        case 1:
        case 3:
        case 5:
-         *rtn = *rt + (r == 0 ? 2 : 3);
+         *rt2 = *rt + (r == 0 ? 2 : 3);
          break;
 
        case 6:
-         *rtn = *rt + r;
+         *rt2 = *rt + r;
          break;
 
        case 7:
-         *rtn = *rt + (r == 0 ? 2 : 3);
+         *rt2 = *rt + (r == 0 ? 2 : 3);
          break;
 
        default:
@@ -2925,7 +2923,7 @@ static bfd_boolean
 aarch64_erratum_sequence (uint32_t insn_1, uint32_t insn_2)
 {
   uint32_t rt;
-  uint32_t rtn;
+  uint32_t rt2;
   uint32_t rn;
   uint32_t rm;
   uint32_t ra;
@@ -2933,7 +2931,7 @@ aarch64_erratum_sequence (uint32_t insn_1, uint32_t insn_2)
   bfd_boolean load;
 
   if (aarch64_mlxl_p (insn_2)
-      && aarch64_mem_op_p (insn_1, &rt, &rtn, &pair, &load))
+      && aarch64_mem_op_p (insn_1, &rt, &rt2, &pair, &load))
     {
       /* Any SIMD memory op is independent of the subsequent MLA
         by definition of the erratum.  */
@@ -2949,7 +2947,7 @@ aarch64_erratum_sequence (uint32_t insn_1, uint32_t insn_2)
         and this is not an erratum sequence.  */
       if (load &&
          (rt == rn || rt == rm || rt == ra
-          || (pair && (rtn == rn || rtn == rm || rtn == ra))))
+          || (pair && (rt2 == rn || rt2 == rm || rt2 == ra))))
        return FALSE;
 
       /* We conservatively put out stubs for all other cases (including
@@ -3084,13 +3082,11 @@ erratum_835769_scan (bfd *input_bfd,
   return FALSE;
 }
 
-/* Find or create a stub section.  Returns a pointer to the stub section, and
-   the section to which the stub section will be attached (in *LINK_SEC_P).
-   LINK_SEC_P may be NULL.  */
+/* Find or create a stub section.  */
 
 static asection *
-elf_aarch64_create_or_find_stub_sec (asection **link_sec_p, asection *section,
-                                  struct elf_aarch64_link_hash_table *htab)
+elf_aarch64_create_or_find_stub_sec (asection *section,
+                                    struct elf_aarch64_link_hash_table *htab)
 {
   asection *link_sec;
   asection *stub_sec;
@@ -3125,9 +3121,6 @@ elf_aarch64_create_or_find_stub_sec (asection **link_sec_p, asection *section,
       htab->stub_group[section->id].stub_sec = stub_sec;
     }
 
-  if (link_sec_p)
-    *link_sec_p = link_sec;
-
   return stub_sec;
 }
 
@@ -3193,13 +3186,12 @@ elfNN_aarch64_size_stubs (bfd *output_bfd,
   while (1)
     {
       bfd *input_bfd;
-      unsigned int bfd_indx;
       asection *stub_sec;
       unsigned prev_num_erratum_835769_fixes = num_erratum_835769_fixes;
 
       num_erratum_835769_fixes = 0;
-      for (input_bfd = info->input_bfds, bfd_indx = 0;
-          input_bfd != NULL; input_bfd = input_bfd->link.next, bfd_indx++)
+      for (input_bfd = info->input_bfds;
+          input_bfd != NULL; input_bfd = input_bfd->link.next)
        {
          Elf_Internal_Shdr *symtab_hdr;
          asection *section;
@@ -3484,8 +3476,8 @@ elfNN_aarch64_size_stubs (bfd *output_bfd,
       if (htab->fix_erratum_835769)
        for (i = 0; i < num_erratum_835769_fixes; i++)
          {
-           stub_sec = elf_aarch64_create_or_find_stub_sec (NULL,
-                        erratum_835769_fixes[i].section, htab);
+           stub_sec = elf_aarch64_create_or_find_stub_sec
+             (erratum_835769_fixes[i].section, htab);
 
            if (stub_sec == NULL)
              goto error_ret_free_local;
@@ -3529,16 +3521,6 @@ elfNN_aarch64_size_stubs (bfd *output_bfd,
          stub_entry->veneered_insn = erratum_835769_fixes[i].veneered_insn;
          stub_entry->output_name = erratum_835769_fixes[i].stub_name;
        }
-
-      /* Stash the erratum 835769 fix array for use later in
-        elfNN_aarch64_write_section().  */
-      htab->aarch64_erratum_835769_fixes = erratum_835769_fixes;
-      htab->num_aarch64_erratum_835769_fixes = num_erratum_835769_fixes;
-    }
-  else
-    {
-      htab->aarch64_erratum_835769_fixes = NULL;
-      htab->num_aarch64_erratum_835769_fixes = 0;
     }
 
   return TRUE;
@@ -4074,7 +4056,7 @@ elfNN_aarch64_write_section (bfd *output_bfd  ATTRIBUTE_UNUSED,
 
 {
   struct elf_aarch64_link_hash_table *globals =
-                                       elf_aarch64_hash_table (link_info);
+    elf_aarch64_hash_table (link_info);
 
   if (globals == NULL)
     return FALSE;
@@ -6552,7 +6534,7 @@ aarch64_map_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
        return FALSE;
       break;
     default:
-      BFD_FAIL ();
+      abort ();
     }
 
   return TRUE;
This page took 0.032899 seconds and 4 git commands to generate.