]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - binutils/patches/binutils-2.24-aarch64-fix-final_link_relocate.patch
binutils: Update to 2.24
[people/ms/ipfire-3.x.git] / binutils / patches / binutils-2.24-aarch64-fix-final_link_relocate.patch
1 commit f44a1f8e513b37bcc52ba9ea0c172c3e94852756
2 Author: Christophe Lyon <christophe.lyon@st.com>
3 Date: Tue Jan 14 15:53:50 2014 +0100
4
5 2014-01-14 Michael Hudson-Doyle <michael.hudson@linaro.org>
6 Kugan Vivekanandarajah <kugan.vivekanandarajah@linaro.org>
7
8 bfd/
9 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use correct
10 offset while calculating relocation address.
11 (elfNN_aarch64_create_small_pltn_entry): Likewise.
12 (elfNN_aarch64_init_small_plt0_entry): Likewise.
13
14 --- a/bfd/elfnn-aarch64.c
15 +++ b/bfd/elfnn-aarch64.c
16 @@ -3844,7 +3844,7 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
17
18 value = (symbol_got_offset (input_bfd, h, r_symndx)
19 + globals->root.sgot->output_section->vma
20 - + globals->root.sgot->output_section->output_offset);
21 + + globals->root.sgot->output_offset);
22
23 value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,
24 0, weak_undef_p);
25 @@ -3873,10 +3873,9 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
26 case BFD_RELOC_AARCH64_TLSDESC_LDR:
27 if (globals->root.sgot == NULL)
28 return bfd_reloc_notsupported;
29 -
30 value = (symbol_tlsdesc_got_offset (input_bfd, h, r_symndx)
31 + globals->root.sgotplt->output_section->vma
32 - + globals->root.sgotplt->output_section->output_offset
33 + + globals->root.sgotplt->output_offset
34 + globals->sgotplt_jump_table_size);
35
36 value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,
37 @@ -6627,7 +6626,7 @@ elfNN_aarch64_create_small_pltn_entry (struct elf_link_hash_entry *h,
38
39 plt_entry = plt->contents + h->plt.offset;
40 plt_entry_address = plt->output_section->vma
41 - + plt->output_section->output_offset + h->plt.offset;
42 + + plt->output_offset + h->plt.offset;
43 gotplt_entry_address = gotplt->output_section->vma +
44 gotplt->output_offset + got_offset;
45
46 @@ -6934,7 +6933,7 @@ elfNN_aarch64_init_small_plt0_entry (bfd *output_bfd ATTRIBUTE_UNUSED,
47 + GOT_ENTRY_SIZE * 2);
48
49 plt_base = htab->root.splt->output_section->vma +
50 - htab->root.splt->output_section->output_offset;
51 + htab->root.splt->output_offset;
52
53 /* Fill in the top 21 bits for this: ADRP x16, PLT_GOT + n * 8.
54 ADRP: ((PG(S+A)-PG(P)) >> 12) & 0x1fffff */