* elf64-ppc.c (ppc64_elf_relocate_section): Correct pcrel section zero.
authorAlan Modra <amodra@gmail.com>
Tue, 17 Jun 2003 00:25:45 +0000 (00:25 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 17 Jun 2003 00:25:45 +0000 (00:25 +0000)
bfd/ChangeLog
bfd/elf64-ppc.c

index 26efd2f32081b0b1183be0c9433232222f973437..0d6084237a66eb5fe143fb23f00784476f770e5c 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-17  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf64-ppc.c (ppc64_elf_relocate_section): Correct pcrel section zero.
+
 2003-06-16  Alan Modra  <amodra@bigpond.net.au>
 
        * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing toctprel
index 31b52e219d8e52af2ee2c3cc558649f31b9ea650..0536ab0414d7fbc3415f8134cc3c4e3a38c41775 100644 (file)
@@ -8349,7 +8349,9 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                    addend = outrel.r_addend;
                  /* Adjust pc_relative relocs to have zero in *r_offset.  */
                  else if (ppc64_elf_howto_table[(int) r_type]->pc_relative)
-                   addend = outrel.r_offset;
+                   addend = (input_section->output_section->vma
+                             + input_section->output_offset
+                             + rel->r_offset);
                }
            }
          break;