daily update
[deliverable/binutils-gdb.git] / bfd / elf32-mips.c
index 8cd47429019e12c2268dafb711fe2d1957cd5e43..0c44c4e86e04e04bdeacfb9f12c2307dfb3e339a 100644 (file)
@@ -2094,8 +2094,8 @@ gprel16_with_gp (abfd, symbol, reloc_entry, input_section, relocateable, data,
       || (symbol->flags & BSF_SECTION_SYM) != 0)
     val += relocation - gp;
 
-  insn = (insn &~ (bfd_vma) 0xffff) | (val & 0xffff);
-  bfd_put_32 (abfd, (bfd_vma) insn, (bfd_byte *) data + reloc_entry->address);
+  insn = (insn & ~0xffff) | (val & 0xffff);
+  bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address);
 
   if (relocateable)
     reloc_entry->address += input_section->output_offset;
@@ -2955,7 +2955,7 @@ _bfd_mips_elf_final_write_processing (abfd, linker)
   /* Set the sh_info field for .gptab sections and other appropriate
      info for each special section.  */
   for (i = 1, hdrpp = elf_elfsections (abfd) + 1;
-       i < elf_elfheader (abfd)->e_shnum;
+       i < elf_numsections (abfd);
        i++, hdrpp++)
     {
       switch ((*hdrpp)->sh_type)
@@ -3036,27 +3036,6 @@ _bfd_mips_elf_set_private_flags (abfd, flags)
   return true;
 }
 
-/* Copy backend specific data from one object module to another */
-
-boolean
-_bfd_mips_elf_copy_private_bfd_data (ibfd, obfd)
-     bfd *ibfd;
-     bfd *obfd;
-{
-  if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
-      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
-    return true;
-
-  BFD_ASSERT (!elf_flags_init (obfd)
-             || (elf_elfheader (obfd)->e_flags
-                 == elf_elfheader (ibfd)->e_flags));
-
-  elf_gp (obfd) = elf_gp (ibfd);
-  elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
-  elf_flags_init (obfd) = true;
-  return true;
-}
-
 /* Merge backend specific data from an object file to the output
    object file when linking.  */
 
@@ -6358,29 +6337,10 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec,
              < sreloc->_raw_size);
 
   skip = false;
-
-  /* We begin by assuming that the offset for the dynamic relocation
-     is the same as for the original relocation.  We'll adjust this
-     later to reflect the correct output offsets.  */
-  if (elf_section_data (input_section)->stab_info == NULL)
-    outrel.r_offset = rel->r_offset;
-  else
-    {
-      /* Except that in a stab section things are more complex.
-        Because we compress stab information, the offset given in the
-        relocation may not be the one we want; we must let the stabs
-        machinery tell us the offset.  */
-      outrel.r_offset
-       = (_bfd_stab_section_offset
-          (output_bfd, &elf_hash_table (info)->stab_info,
-           input_section,
-           &elf_section_data (input_section)->stab_info,
-           rel->r_offset));
-      /* If we didn't need the relocation at all, this value will be
-        -1.  */
-      if (outrel.r_offset == (bfd_vma) -1)
-       skip = true;
-    }
+  outrel.r_offset =
+    _bfd_elf_section_offset (output_bfd, info, input_section, rel->r_offset);
+  if (outrel.r_offset == (bfd_vma) -1)
+    skip = true;
 
   /* If we've decided to skip this relocation, just output an empty
      record.  Note that R_MIPS_NONE == 0, so that this call to memset
@@ -7554,7 +7514,7 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                }
 
              if (!mips_elf_perform_relocation (info, howto, rel, addend,
-                                               input_bfd,  input_section,
+                                               input_bfd, input_section,
                                                contents, false))
                return false;
            }
@@ -8558,13 +8518,7 @@ _bfd_mips_elf_gc_mark_hook (abfd, info, rel, h, sym)
     }
   else
     {
-      if (!(elf_bad_symtab (abfd)
-           && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
-         && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
-               && sym->st_shndx != SHN_COMMON))
-       {
-         return bfd_section_from_elf_index (abfd, sym->st_shndx);
-       }
+      return bfd_section_from_elf_index (abfd, sym->st_shndx);
     }
 
   return NULL;
@@ -10170,8 +10124,6 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
 #define bfd_elf32_bfd_link_hash_table_create \
                                        _bfd_mips_elf_link_hash_table_create
 #define bfd_elf32_bfd_final_link       _bfd_mips_elf_final_link
-#define bfd_elf32_bfd_copy_private_bfd_data \
-                                       _bfd_mips_elf_copy_private_bfd_data
 #define bfd_elf32_bfd_merge_private_bfd_data \
                                        _bfd_mips_elf_merge_private_bfd_data
 #define bfd_elf32_bfd_set_private_flags        _bfd_mips_elf_set_private_flags
This page took 0.025189 seconds and 4 git commands to generate.