PR ld/6590
authorAlan Modra <amodra@gmail.com>
Thu, 5 Jun 2008 00:30:09 +0000 (00:30 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 5 Jun 2008 00:30:09 +0000 (00:30 +0000)
* elf64-ppc.c (ppc_build_one_stub): Correct reloc offsets.

bfd/ChangeLog
bfd/elf64-ppc.c

index c61360e4b6adeb94eac9f5fb357f618baea1cc18..470e3a2d65a654403e9bf74bc26a9f9a46d2af3d 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-05  Alan Modra  <amodra@bigpond.net.au>
+
+       PR ld/6590
+       * elf64-ppc.c (ppc_build_one_stub): Correct reloc offsets.
+
 2008-06-04  Alan Modra  <amodra@bigpond.net.au>
 
        * elf.c (ignore_section_sym): Don't test section sym value here.
index 8a26c8daffd55118734d384c13038f5003db9bc2..06b14768bb23776985d37c51ff62f805b8269156 100644 (file)
@@ -8708,6 +8708,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
          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_entry *gen_entry, void *in_arg)
          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);