Blame SOURCES/binutils-rh1075827.patch

881b8e
Backport of f44a1f8e513b37bcc52ba9ea0c172c3e94852756:
881b8e
881b8e
2014-01-14  Michael Hudson-Doyle  <michael.hudson@linaro.org>
881b8e
	    Kugan Vivekanandarajah  <kugan.vivekanandarajah@linaro.org>
881b8e
881b8e
	* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use correct
881b8e
	offset while calculating relocation address.
881b8e
	(elfNN_aarch64_create_small_pltn_entry): Likewise.
881b8e
	(elfNN_aarch64_init_small_plt0_entry): Likewise.
881b8e
881b8e
881b8e
--- a/bfd/elf64-aarch64.c	2013-02-27 15:28:03.000000000 -0500
881b8e
+++ b/bfd/elf64-aarch64.c	2014-03-13 13:47:08.003066253 -0400
881b8e
@@ -4060,7 +4060,7 @@
881b8e
 
881b8e
       value = (symbol_got_offset (input_bfd, h, r_symndx)
881b8e
 	       + globals->root.sgot->output_section->vma
881b8e
-	       + globals->root.sgot->output_section->output_offset);
881b8e
+	       + globals->root.sgot->output_offset);
881b8e
 
881b8e
       value = aarch64_resolve_relocation (r_type, place, value,
881b8e
 					  0, weak_undef_p);
881b8e
@@ -4090,7 +4090,7 @@
881b8e
 
881b8e
       value = (symbol_tlsdesc_got_offset (input_bfd, h, r_symndx)
881b8e
 	       + globals->root.sgotplt->output_section->vma
881b8e
-	       + globals->root.sgotplt->output_section->output_offset
881b8e
+	       + globals->root.sgotplt->output_offset
881b8e
 	       + globals->sgotplt_jump_table_size);
881b8e
 
881b8e
       value = aarch64_resolve_relocation (r_type, place, value,
881b8e
@@ -6454,7 +6454,7 @@
881b8e
   got_offset = (plt_index + 3) * GOT_ENTRY_SIZE;
881b8e
   plt_entry = htab->root.splt->contents + h->plt.offset;
881b8e
   plt_entry_address = htab->root.splt->output_section->vma
881b8e
-    + htab->root.splt->output_section->output_offset + h->plt.offset;
881b8e
+    + htab->root.splt->output_offset + h->plt.offset;
881b8e
   gotplt_entry_address = htab->root.sgotplt->output_section->vma +
881b8e
     htab->root.sgotplt->output_offset + got_offset;
881b8e
 
881b8e
@@ -6676,7 +6676,7 @@
881b8e
 		  + htab->root.sgotplt->output_offset);
881b8e
 
881b8e
   plt_base = htab->root.splt->output_section->vma +
881b8e
-    htab->root.splt->output_section->output_offset;
881b8e
+    htab->root.splt->output_offset;
881b8e
 
881b8e
   /* Fill in the top 21 bits for this: ADRP x16, PLT_GOT + n * 8.
881b8e
      ADRP:   ((PG(S+A)-PG(P)) >> 12) & 0x1fffff */