/* 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;
template_size = sizeof (aarch64_erratum_835769_stub);
break;
default:
- BFD_FAIL ();
- return FALSE;
+ abort ();
}
for (i = 0; i < (template_size / sizeof template[0]); i++)
break;
default:
- break;
+ abort ();
}
return TRUE;
size = sizeof (aarch64_erratum_835769_stub);
break;
default:
- BFD_FAIL ();
- return FALSE;
- break;
+ abort ();
}
size = (size + 7) & ~7;
#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;
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;
{
*pair = TRUE;
*rt = AARCH64_RT (insn);
- *rtn = AARCH64_RT2 (insn);
+ *rt2 = AARCH64_RT2 (insn);
*load = AARCH64_LD (insn);
return TRUE;
}
|| 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);
{
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:
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:
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;
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. */
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
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;
htab->stub_group[section->id].stub_sec = stub_sec;
}
- if (link_sec_p)
- *link_sec_p = link_sec;
-
return stub_sec;
}
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;
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;
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;
{
struct elf_aarch64_link_hash_table *globals =
- elf_aarch64_hash_table (link_info);
+ elf_aarch64_hash_table (link_info);
if (globals == NULL)
return FALSE;
return FALSE;
break;
default:
- BFD_FAIL ();
+ abort ();
}
return TRUE;