[AArch64/BFD] Sort relocation case labels alphabetically

2015-05-19  Jiong Wang  <jiong.wang@arm.com>

    bfd/
	* elfnn-aarch64.c (aarch64_tls_transition_without_check): Sort
	relocation case labels alphabetically.
	(elfNN_aarch64_final_link_relocate): Ditto.
	(elfNN_aarch64_tls_relax): Ditto.
	(elfNN_aarch64_relocate_section): Ditto.
	(elfNN_aarch64_gc_sweep_hook): Ditto.
	(elfNN_aarch64_check_relocs): Ditto.
	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
	(_bfd_aarch64_elf_resolve_relocation): Ditto.
This commit is contained in:
Jiong Wang
2015-05-20 10:58:43 +01:00
parent f09c556a25
commit ce33678882
3 changed files with 94 additions and 82 deletions

View File

@ -1,3 +1,15 @@
2015-05-19 Jiong Wang <jiong.wang@arm.com>
* elfnn-aarch64.c (aarch64_tls_transition_without_check): Sort
relocation case labels alphabetically.
(elfNN_aarch64_final_link_relocate): Ditto.
(elfNN_aarch64_tls_relax): Ditto.
(elfNN_aarch64_relocate_section): Ditto.
(elfNN_aarch64_gc_sweep_hook): Ditto.
(elfNN_aarch64_check_relocs): Ditto.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
(_bfd_aarch64_elf_resolve_relocation): Ditto.
2015-05-18 Jiong Wang <jiong.wang@arm.com> 2015-05-18 Jiong Wang <jiong.wang@arm.com>
* elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Rewrite * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Rewrite

View File

@ -3980,8 +3980,8 @@ aarch64_tls_transition_without_check (bfd_reloc_code_real_type r_type,
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21: case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21:
case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
return (is_local return (is_local
? BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1 ? BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1
: BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21); : BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21);
@ -3996,8 +3996,8 @@ aarch64_tls_transition_without_check (bfd_reloc_code_real_type r_type,
? BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1 ? BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1
: BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19); : BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19);
case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
case BFD_RELOC_AARCH64_TLSDESC_LDNN_LO12_NC: case BFD_RELOC_AARCH64_TLSDESC_LDNN_LO12_NC:
case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
return (is_local return (is_local
? BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC ? BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC
: BFD_RELOC_AARCH64_TLSIE_LDNN_GOTTPREL_LO12_NC); : BFD_RELOC_AARCH64_TLSIE_LDNN_GOTTPREL_LO12_NC);
@ -4033,29 +4033,29 @@ aarch64_reloc_got_type (bfd_reloc_code_real_type r_type)
{ {
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC:
case BFD_RELOC_AARCH64_ADR_GOT_PAGE: case BFD_RELOC_AARCH64_ADR_GOT_PAGE:
case BFD_RELOC_AARCH64_GOT_LD_PREL19: case BFD_RELOC_AARCH64_GOT_LD_PREL19:
case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC:
case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
return GOT_NORMAL; return GOT_NORMAL;
case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21: case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21: case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21:
case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
return GOT_TLS_GD; return GOT_TLS_GD;
case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC: case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC:
case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21: case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21:
case BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21: case BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21:
case BFD_RELOC_AARCH64_TLSDESC_CALL: case BFD_RELOC_AARCH64_TLSDESC_CALL:
case BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC:
case BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC: case BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC:
case BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC:
case BFD_RELOC_AARCH64_TLSDESC_LD_PREL19: case BFD_RELOC_AARCH64_TLSDESC_LD_PREL19:
return GOT_TLSDESC_GD; return GOT_TLSDESC_GD;
case BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: case BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19: case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
return GOT_TLS_IE; return GOT_TLS_IE;
@ -4578,17 +4578,17 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
return bfd_reloc_ok; return bfd_reloc_ok;
} }
/* FALLTHROUGH */ /* FALLTHROUGH */
case BFD_RELOC_AARCH64_JUMP26:
case BFD_RELOC_AARCH64_CALL26: case BFD_RELOC_AARCH64_CALL26:
case BFD_RELOC_AARCH64_JUMP26:
value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value, value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,
signed_addend, signed_addend,
weak_undef_p); weak_undef_p);
return _bfd_aarch64_elf_put_addend (input_bfd, hit_data, bfd_r_type, return _bfd_aarch64_elf_put_addend (input_bfd, hit_data, bfd_r_type,
howto, value); howto, value);
case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC:
case BFD_RELOC_AARCH64_ADR_GOT_PAGE: case BFD_RELOC_AARCH64_ADR_GOT_PAGE:
case BFD_RELOC_AARCH64_GOT_LD_PREL19: case BFD_RELOC_AARCH64_GOT_LD_PREL19:
case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC:
case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
base_got = globals->root.sgot; base_got = globals->root.sgot;
off = h->got.offset; off = h->got.offset;
@ -4650,8 +4650,8 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value, value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,
0, weak_undef_p); 0, weak_undef_p);
return _bfd_aarch64_elf_put_addend (input_bfd, hit_data, bfd_r_type, howto, value); return _bfd_aarch64_elf_put_addend (input_bfd, hit_data, bfd_r_type, howto, value);
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
case BFD_RELOC_AARCH64_ADD_LO12: case BFD_RELOC_AARCH64_ADD_LO12:
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
break; break;
} }
} }
@ -4746,8 +4746,8 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
value += signed_addend; value += signed_addend;
break; break;
case BFD_RELOC_AARCH64_JUMP26:
case BFD_RELOC_AARCH64_CALL26: case BFD_RELOC_AARCH64_CALL26:
case BFD_RELOC_AARCH64_JUMP26:
{ {
asection *splt = globals->root.splt; asection *splt = globals->root.splt;
bfd_boolean via_plt_p = bfd_boolean via_plt_p =
@ -4800,13 +4800,13 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
signed_addend, weak_undef_p); signed_addend, weak_undef_p);
break; break;
case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
case BFD_RELOC_AARCH64_LD_LO19_PCREL:
case BFD_RELOC_AARCH64_16_PCREL: case BFD_RELOC_AARCH64_16_PCREL:
case BFD_RELOC_AARCH64_32_PCREL: case BFD_RELOC_AARCH64_32_PCREL:
case BFD_RELOC_AARCH64_64_PCREL: case BFD_RELOC_AARCH64_64_PCREL:
case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
case BFD_RELOC_AARCH64_LD_LO19_PCREL:
if (info->shared if (info->shared
&& (input_section->flags & SEC_ALLOC) != 0 && (input_section->flags & SEC_ALLOC) != 0
&& (input_section->flags & SEC_READONLY) != 0 && (input_section->flags & SEC_READONLY) != 0
@ -4830,30 +4830,30 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
#endif #endif
case BFD_RELOC_AARCH64_ADD_LO12: case BFD_RELOC_AARCH64_ADD_LO12:
case BFD_RELOC_AARCH64_BRANCH19: case BFD_RELOC_AARCH64_BRANCH19:
case BFD_RELOC_AARCH64_LDST8_LO12: case BFD_RELOC_AARCH64_LDST128_LO12:
case BFD_RELOC_AARCH64_LDST16_LO12: case BFD_RELOC_AARCH64_LDST16_LO12:
case BFD_RELOC_AARCH64_LDST32_LO12: case BFD_RELOC_AARCH64_LDST32_LO12:
case BFD_RELOC_AARCH64_LDST64_LO12: case BFD_RELOC_AARCH64_LDST64_LO12:
case BFD_RELOC_AARCH64_LDST128_LO12: case BFD_RELOC_AARCH64_LDST8_LO12:
case BFD_RELOC_AARCH64_MOVW_G0_S:
case BFD_RELOC_AARCH64_MOVW_G1_S:
case BFD_RELOC_AARCH64_MOVW_G2_S:
case BFD_RELOC_AARCH64_MOVW_G0: case BFD_RELOC_AARCH64_MOVW_G0:
case BFD_RELOC_AARCH64_MOVW_G0_NC: case BFD_RELOC_AARCH64_MOVW_G0_NC:
case BFD_RELOC_AARCH64_MOVW_G0_S:
case BFD_RELOC_AARCH64_MOVW_G1: case BFD_RELOC_AARCH64_MOVW_G1:
case BFD_RELOC_AARCH64_MOVW_G1_NC: case BFD_RELOC_AARCH64_MOVW_G1_NC:
case BFD_RELOC_AARCH64_MOVW_G1_S:
case BFD_RELOC_AARCH64_MOVW_G2: case BFD_RELOC_AARCH64_MOVW_G2:
case BFD_RELOC_AARCH64_MOVW_G2_NC: case BFD_RELOC_AARCH64_MOVW_G2_NC:
case BFD_RELOC_AARCH64_MOVW_G2_S:
case BFD_RELOC_AARCH64_MOVW_G3: case BFD_RELOC_AARCH64_MOVW_G3:
case BFD_RELOC_AARCH64_TSTBR14: case BFD_RELOC_AARCH64_TSTBR14:
value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value, value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,
signed_addend, weak_undef_p); signed_addend, weak_undef_p);
break; break;
case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC:
case BFD_RELOC_AARCH64_ADR_GOT_PAGE: case BFD_RELOC_AARCH64_ADR_GOT_PAGE:
case BFD_RELOC_AARCH64_GOT_LD_PREL19: case BFD_RELOC_AARCH64_GOT_LD_PREL19:
case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC:
case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
if (globals->root.sgot == NULL) if (globals->root.sgot == NULL)
BFD_ASSERT (h != NULL); BFD_ASSERT (h != NULL);
@ -4919,12 +4919,12 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
break; break;
case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21: case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21: case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21:
case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
case BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: case BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19: case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
if (globals->root.sgot == NULL) if (globals->root.sgot == NULL)
return bfd_reloc_notsupported; return bfd_reloc_notsupported;
@ -5008,8 +5008,8 @@ elfNN_aarch64_tls_relax (struct elf_aarch64_link_hash_table *globals,
switch (elfNN_aarch64_bfd_reloc_from_type (r_type)) switch (elfNN_aarch64_bfd_reloc_from_type (r_type))
{ {
case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21: case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21:
case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
if (is_local) if (is_local)
{ {
/* GD->LE relaxation: /* GD->LE relaxation:
@ -5407,9 +5407,9 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
switch (elfNN_aarch64_bfd_reloc_from_type (r_type)) switch (elfNN_aarch64_bfd_reloc_from_type (r_type))
{ {
case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21: case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21: case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21:
case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
if (! symbol_got_offset_mark_p (input_bfd, h, r_symndx)) if (! symbol_got_offset_mark_p (input_bfd, h, r_symndx))
{ {
bfd_boolean need_relocs = FALSE; bfd_boolean need_relocs = FALSE;
@ -5537,14 +5537,14 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
} }
break; break;
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12:
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12: case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12:
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12:
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2:
break; break;
case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC: case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC:
@ -5961,13 +5961,13 @@ elfNN_aarch64_gc_sweep_hook (bfd *abfd,
h->plt.refcount -= 1; h->plt.refcount -= 1;
break; break;
case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
case BFD_RELOC_AARCH64_MOVW_G0_NC: case BFD_RELOC_AARCH64_MOVW_G0_NC:
case BFD_RELOC_AARCH64_MOVW_G1_NC: case BFD_RELOC_AARCH64_MOVW_G1_NC:
case BFD_RELOC_AARCH64_MOVW_G2_NC: case BFD_RELOC_AARCH64_MOVW_G2_NC:
case BFD_RELOC_AARCH64_MOVW_G3: case BFD_RELOC_AARCH64_MOVW_G3:
case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
case BFD_RELOC_AARCH64_NN: case BFD_RELOC_AARCH64_NN:
if (h != NULL && info->executable) if (h != NULL && info->executable)
{ {
@ -6260,15 +6260,15 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
default: default:
break; break;
case BFD_RELOC_AARCH64_NN: case BFD_RELOC_AARCH64_ADD_LO12:
case BFD_RELOC_AARCH64_ADR_GOT_PAGE:
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
case BFD_RELOC_AARCH64_CALL26: case BFD_RELOC_AARCH64_CALL26:
case BFD_RELOC_AARCH64_GOT_LD_PREL19:
case BFD_RELOC_AARCH64_JUMP26: case BFD_RELOC_AARCH64_JUMP26:
case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC: case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC:
case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC: case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
case BFD_RELOC_AARCH64_ADR_GOT_PAGE: case BFD_RELOC_AARCH64_NN:
case BFD_RELOC_AARCH64_GOT_LD_PREL19:
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
case BFD_RELOC_AARCH64_ADD_LO12:
if (htab->root.dynobj == NULL) if (htab->root.dynobj == NULL)
htab->root.dynobj = abfd; htab->root.dynobj = abfd;
if (!_bfd_elf_create_ifunc_sections (htab->root.dynobj, info)) if (!_bfd_elf_create_ifunc_sections (htab->root.dynobj, info))

View File

@ -207,8 +207,8 @@ _bfd_aarch64_elf_put_addend (bfd *abfd,
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_AARCH64_JUMP26:
case BFD_RELOC_AARCH64_CALL26: case BFD_RELOC_AARCH64_CALL26:
case BFD_RELOC_AARCH64_JUMP26:
contents = reencode_branch_ofs_26 (contents, addend); contents = reencode_branch_ofs_26 (contents, addend);
break; break;
@ -220,9 +220,9 @@ _bfd_aarch64_elf_put_addend (bfd *abfd,
contents = reencode_tst_branch_ofs_14 (contents, addend); contents = reencode_tst_branch_ofs_14 (contents, addend);
break; break;
case BFD_RELOC_AARCH64_TLSDESC_LD_PREL19:
case BFD_RELOC_AARCH64_LD_LO19_PCREL:
case BFD_RELOC_AARCH64_GOT_LD_PREL19: case BFD_RELOC_AARCH64_GOT_LD_PREL19:
case BFD_RELOC_AARCH64_LD_LO19_PCREL:
case BFD_RELOC_AARCH64_TLSDESC_LD_PREL19:
case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19: case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
if (old_addend & ((1 << howto->rightshift) - 1)) if (old_addend & ((1 << howto->rightshift) - 1))
return bfd_reloc_overflow; return bfd_reloc_overflow;
@ -232,24 +232,24 @@ _bfd_aarch64_elf_put_addend (bfd *abfd,
case BFD_RELOC_AARCH64_TLSDESC_CALL: case BFD_RELOC_AARCH64_TLSDESC_CALL:
break; break;
case BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21:
case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21:
case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
case BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21:
case BFD_RELOC_AARCH64_ADR_GOT_PAGE: case BFD_RELOC_AARCH64_ADR_GOT_PAGE:
case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL: case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21:
case BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21:
case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21:
case BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
contents = _bfd_aarch64_reencode_adr_imm (contents, addend); contents = _bfd_aarch64_reencode_adr_imm (contents, addend);
break; break;
case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12:
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12:
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC:
case BFD_RELOC_AARCH64_ADD_LO12: case BFD_RELOC_AARCH64_ADD_LO12:
case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC:
case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12:
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12:
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
/* Corresponds to: add rd, rn, #uimm12 to provide the low order /* Corresponds to: add rd, rn, #uimm12 to provide the low order
12 bits of the page offset following 12 bits of the page offset following
BFD_RELOC_AARCH64_ADR_HI21_PCREL which computes the BFD_RELOC_AARCH64_ADR_HI21_PCREL which computes the
@ -257,17 +257,17 @@ _bfd_aarch64_elf_put_addend (bfd *abfd,
contents = reencode_add_imm (contents, addend); contents = reencode_add_imm (contents, addend);
break; break;
case BFD_RELOC_AARCH64_LDST8_LO12: case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC:
case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
case BFD_RELOC_AARCH64_LDST128_LO12:
case BFD_RELOC_AARCH64_LDST16_LO12: case BFD_RELOC_AARCH64_LDST16_LO12:
case BFD_RELOC_AARCH64_LDST32_LO12: case BFD_RELOC_AARCH64_LDST32_LO12:
case BFD_RELOC_AARCH64_LDST64_LO12: case BFD_RELOC_AARCH64_LDST64_LO12:
case BFD_RELOC_AARCH64_LDST128_LO12: case BFD_RELOC_AARCH64_LDST8_LO12:
case BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC:
case BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC: case BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC:
case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC:
case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC:
if (old_addend & ((1 << howto->rightshift) - 1)) if (old_addend & ((1 << howto->rightshift) - 1))
return bfd_reloc_overflow; return bfd_reloc_overflow;
/* Used for ldr*|str* rt, [rn, #uimm12] to provide the low order /* Used for ldr*|str* rt, [rn, #uimm12] to provide the low order
@ -281,12 +281,12 @@ _bfd_aarch64_elf_put_addend (bfd *abfd,
instruction to MOVN or MOVZ depending on sign of calculated instruction to MOVN or MOVZ depending on sign of calculated
value. */ value. */
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0:
case BFD_RELOC_AARCH64_MOVW_G0_S: case BFD_RELOC_AARCH64_MOVW_G0_S:
case BFD_RELOC_AARCH64_MOVW_G1_S: case BFD_RELOC_AARCH64_MOVW_G1_S:
case BFD_RELOC_AARCH64_MOVW_G2_S: case BFD_RELOC_AARCH64_MOVW_G2_S:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2:
/* NOTE: We can only come here with movz or movn. */ /* NOTE: We can only come here with movz or movn. */
if (addend < 0) if (addend < 0)
{ {
@ -304,8 +304,6 @@ _bfd_aarch64_elf_put_addend (bfd *abfd,
/* Group relocations to create a 16, 32, 48 or 64 bit unsigned /* Group relocations to create a 16, 32, 48 or 64 bit unsigned
data or abs address inline. */ data or abs address inline. */
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC:
case BFD_RELOC_AARCH64_MOVW_G0: case BFD_RELOC_AARCH64_MOVW_G0:
case BFD_RELOC_AARCH64_MOVW_G0_NC: case BFD_RELOC_AARCH64_MOVW_G0_NC:
case BFD_RELOC_AARCH64_MOVW_G1: case BFD_RELOC_AARCH64_MOVW_G1:
@ -313,6 +311,8 @@ _bfd_aarch64_elf_put_addend (bfd *abfd,
case BFD_RELOC_AARCH64_MOVW_G2: case BFD_RELOC_AARCH64_MOVW_G2:
case BFD_RELOC_AARCH64_MOVW_G2_NC: case BFD_RELOC_AARCH64_MOVW_G2_NC:
case BFD_RELOC_AARCH64_MOVW_G3: case BFD_RELOC_AARCH64_MOVW_G3:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC:
contents = reencode_movw_imm (contents, addend); contents = reencode_movw_imm (contents, addend);
break; break;
@ -355,20 +355,20 @@ _bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type r_type,
{ {
switch (r_type) switch (r_type)
{ {
case BFD_RELOC_AARCH64_TLSDESC_CALL:
case BFD_RELOC_AARCH64_NONE: case BFD_RELOC_AARCH64_NONE:
case BFD_RELOC_AARCH64_TLSDESC_CALL:
break; break;
case BFD_RELOC_AARCH64_16_PCREL:
case BFD_RELOC_AARCH64_32_PCREL:
case BFD_RELOC_AARCH64_64_PCREL:
case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
case BFD_RELOC_AARCH64_BRANCH19:
case BFD_RELOC_AARCH64_LD_LO19_PCREL:
case BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21: case BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21:
case BFD_RELOC_AARCH64_TLSDESC_LD_PREL19: case BFD_RELOC_AARCH64_TLSDESC_LD_PREL19:
case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21: case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21:
case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19: case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
case BFD_RELOC_AARCH64_BRANCH19:
case BFD_RELOC_AARCH64_LD_LO19_PCREL:
case BFD_RELOC_AARCH64_16_PCREL:
case BFD_RELOC_AARCH64_32_PCREL:
case BFD_RELOC_AARCH64_64_PCREL:
case BFD_RELOC_AARCH64_TSTBR14: case BFD_RELOC_AARCH64_TSTBR14:
if (weak_undef_p) if (weak_undef_p)
value = place; value = place;
@ -382,21 +382,21 @@ _bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type r_type,
case BFD_RELOC_AARCH64_16: case BFD_RELOC_AARCH64_16:
case BFD_RELOC_AARCH64_32: case BFD_RELOC_AARCH64_32:
case BFD_RELOC_AARCH64_MOVW_G0_S:
case BFD_RELOC_AARCH64_MOVW_G1_S:
case BFD_RELOC_AARCH64_MOVW_G2_S:
case BFD_RELOC_AARCH64_MOVW_G0: case BFD_RELOC_AARCH64_MOVW_G0:
case BFD_RELOC_AARCH64_MOVW_G0_NC: case BFD_RELOC_AARCH64_MOVW_G0_NC:
case BFD_RELOC_AARCH64_MOVW_G0_S:
case BFD_RELOC_AARCH64_MOVW_G1: case BFD_RELOC_AARCH64_MOVW_G1:
case BFD_RELOC_AARCH64_MOVW_G1_NC: case BFD_RELOC_AARCH64_MOVW_G1_NC:
case BFD_RELOC_AARCH64_MOVW_G1_S:
case BFD_RELOC_AARCH64_MOVW_G2: case BFD_RELOC_AARCH64_MOVW_G2:
case BFD_RELOC_AARCH64_MOVW_G2_NC: case BFD_RELOC_AARCH64_MOVW_G2_NC:
case BFD_RELOC_AARCH64_MOVW_G2_S:
case BFD_RELOC_AARCH64_MOVW_G3: case BFD_RELOC_AARCH64_MOVW_G3:
value = value + addend; value = value + addend;
break; break;
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL: case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
if (weak_undef_p) if (weak_undef_p)
value = PG (place); value = PG (place);
value = PG (value + addend) - PG (place); value = PG (value + addend) - PG (place);
@ -414,21 +414,21 @@ _bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type r_type,
break; break;
case BFD_RELOC_AARCH64_ADD_LO12: case BFD_RELOC_AARCH64_ADD_LO12:
case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC: case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC:
case BFD_RELOC_AARCH64_LDST8_LO12: case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
case BFD_RELOC_AARCH64_LDST128_LO12:
case BFD_RELOC_AARCH64_LDST16_LO12: case BFD_RELOC_AARCH64_LDST16_LO12:
case BFD_RELOC_AARCH64_LDST32_LO12: case BFD_RELOC_AARCH64_LDST32_LO12:
case BFD_RELOC_AARCH64_LDST64_LO12: case BFD_RELOC_AARCH64_LDST64_LO12:
case BFD_RELOC_AARCH64_LDST128_LO12: case BFD_RELOC_AARCH64_LDST8_LO12:
case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC:
case BFD_RELOC_AARCH64_TLSDESC_ADD: case BFD_RELOC_AARCH64_TLSDESC_ADD:
case BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC: case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC:
case BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC: case BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC:
case BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC:
case BFD_RELOC_AARCH64_TLSDESC_LDR: case BFD_RELOC_AARCH64_TLSDESC_LDR:
case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC: case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12: case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12:
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC: case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
value = PG_OFFSET (value + addend); value = PG_OFFSET (value + addend);