2009-12-15 Tristan Gingold <gingold@adacore.com>
[binutils-gdb.git] / bfd / elf64-ppc.c
index e748a41fcc2ccfabd044ff97947a82eed9011a94..a181c282763601286ba3cbc1fc9c44116e2644ad 100644 (file)
@@ -5401,8 +5401,6 @@ opd_entry_value (asection *opd_sec,
   /* No relocs implies we are linking a --just-symbols object.  */
   if (opd_sec->reloc_count == 0)
     {
-      bfd_vma val;
-
       if (!bfd_get_section_contents (opd_bfd, opd_sec, &val, offset, 8))
        return (bfd_vma) -1;
 
@@ -8575,8 +8573,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
          for (ent = *local_plt; ent != NULL; ent = ent->next)
            if (ent->plt.refcount > 0)
              {
-               asection *s = htab->iplt;
-
+               s = htab->iplt;
                ent->plt.offset = s->size;
                s->size += PLT_ENTRY_SIZE;
 
@@ -11102,8 +11099,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
                  insn1 |= 58 << 26;    /* ld */
                  insn2 = 0x7c636a14;   /* add 3,3,13 */
                  if (offset != (bfd_vma) -1)
-                   rel[1].r_info = ELF64_R_INFO (ELF64_R_SYM (rel[1].r_info),
-                                                 R_PPC64_NONE);
+                   rel[1].r_info = ELF64_R_INFO (STN_UNDEF, R_PPC64_NONE);
                  if ((tls_mask & TLS_EXPLICIT) == 0)
                    r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3)
                              + R_PPC64_GOT_TPREL16_DS);
@@ -11202,8 +11198,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
              rel->r_info = ELF64_R_INFO (r_symndx, r_type);
              /* Zap the reloc on the _tls_get_addr call too.  */
              BFD_ASSERT (offset == rel[1].r_offset);
-             rel[1].r_info = ELF64_R_INFO (ELF64_R_SYM (rel[1].r_info),
-                                           R_PPC64_NONE);
+             rel[1].r_info = ELF64_R_INFO (STN_UNDEF, R_PPC64_NONE);
              insn3 = bfd_get_32 (output_bfd,
                                  contents + offset + 4);
              if (insn3 == NOP
@@ -11248,8 +11243,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
              rel->r_offset = offset + d_offset;
              /* Zap the reloc on the _tls_get_addr call too.  */
              BFD_ASSERT (offset == rel[1].r_offset);
-             rel[1].r_info = ELF64_R_INFO (ELF64_R_SYM (rel[1].r_info),
-                                           R_PPC64_NONE);
+             rel[1].r_info = ELF64_R_INFO (STN_UNDEF, R_PPC64_NONE);
              insn2 = 0x38630000;       /* addi 3,3,0 */
              insn3 = bfd_get_32 (output_bfd,
                                  contents + offset + 4);
@@ -11923,10 +11917,8 @@ ppc64_elf_relocate_section (bfd *output_bfd,
                      ? h->elf.type == STT_GNU_IFUNC
                      : ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)))
            {
-             Elf_Internal_Rela outrel;
              bfd_boolean skip, relocate;
              asection *sreloc;
-             bfd_byte *loc;
              bfd_vma out_off;
 
              /* When generating a dynamic object, these relocations
@@ -12387,9 +12379,6 @@ ppc64_elf_finish_dynamic_symbol (bfd *output_bfd,
 
   if (h->needs_copy)
     {
-      Elf_Internal_Rela rela;
-      bfd_byte *loc;
-
       /* This symbol needs a copy reloc.  Set it up.  */
 
       if (h->dynindx == -1