Fix PR 6590

Alan Modra amodra@bigpond.net.au
Thu Jun 5 07:49:00 GMT 2008


	PR ld/6590
	* elf64-ppc.c (ppc_build_one_stub): Correct reloc offsets.

Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.282
diff -u -p -r1.282 elf64-ppc.c
--- bfd/elf64-ppc.c	14 May 2008 16:00:38 -0000	1.282
+++ bfd/elf64-ppc.c	5 Jun 2008 00:26:46 -0000
@@ -8708,6 +8708,8 @@ ppc_build_one_stub (struct bfd_hash_entr
 	  if (r == NULL)
 	    return FALSE;
 	  r[0].r_offset = loc - stub_entry->stub_sec->contents;
+	  if (bfd_big_endian (info->output_bfd))
+	    r[0].r_offset += 2;
 	  if (stub_entry->stub_type == ppc_stub_plt_branch_r2off)
 	    r[0].r_offset += 4;
 	  r[0].r_info = ELF64_R_INFO (0, R_PPC64_TOC16_DS);
@@ -8829,6 +8831,8 @@ ppc_build_one_stub (struct bfd_hash_entr
 	  if (r == NULL)
 	    return FALSE;
 	  r[0].r_offset = loc - stub_entry->stub_sec->contents;
+	  if (bfd_big_endian (info->output_bfd))
+	    r[0].r_offset += 2;
 	  r[0].r_addend = dest;
 	}
       p = build_plt_stub (htab->stub_bfd, loc, off, r);

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list