bfd: install plugin-api.h as needed
[deliverable/binutils-gdb.git] / bfd / elf64-mips.c
index 95186d4c3aa5c82877120b17d7a43f6630ea79bc..7ed54fac78a4067939ce66190c4004b9623356ac 100644 (file)
@@ -2619,7 +2619,7 @@ mips_elf64_slurp_one_reloc_table (bfd *abfd, asection *asect,
            default:
              if (! used_sym)
                {
-                 if (rela.r_sym == 0)
+                 if (rela.r_sym == STN_UNDEF)
                    relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
                  else
                    {
@@ -2722,13 +2722,13 @@ mips_elf64_slurp_reloc_table (bfd *abfd, asection *asect,
          || asect->reloc_count == 0)
        return TRUE;
 
-      rel_hdr = &d->rel_hdr;
-      reloc_count = NUM_SHDR_ENTRIES (rel_hdr);
-      rel_hdr2 = d->rel_hdr2;
+      rel_hdr = d->rel.hdr;
+      reloc_count = rel_hdr ? NUM_SHDR_ENTRIES (rel_hdr) : 0;
+      rel_hdr2 = d->rela.hdr;
       reloc_count2 = (rel_hdr2 ? NUM_SHDR_ENTRIES (rel_hdr2) : 0);
 
       BFD_ASSERT (asect->reloc_count == reloc_count + reloc_count2);
-      BFD_ASSERT (asect->rel_filepos == rel_hdr->sh_offset
+      BFD_ASSERT ((rel_hdr && asect->rel_filepos == rel_hdr->sh_offset)
                  || (rel_hdr2 && asect->rel_filepos == rel_hdr2->sh_offset));
 
     }
@@ -2756,19 +2756,18 @@ mips_elf64_slurp_reloc_table (bfd *abfd, asection *asect,
   /* The slurp_one_reloc_table routine increments reloc_count.  */
   asect->reloc_count = 0;
 
-  if (! mips_elf64_slurp_one_reloc_table (abfd, asect,
-                                         rel_hdr, reloc_count,
-                                         relents,
-                                         symbols, dynamic))
+  if (rel_hdr != NULL
+      && ! mips_elf64_slurp_one_reloc_table (abfd, asect,
+                                            rel_hdr, reloc_count,
+                                            relents,
+                                            symbols, dynamic))
+    return FALSE;
+  if (rel_hdr2 != NULL
+      && ! mips_elf64_slurp_one_reloc_table (abfd, asect,
+                                            rel_hdr2, reloc_count2,
+                                            relents + reloc_count * 3,
+                                            symbols, dynamic))
     return FALSE;
-  if (d->rel_hdr2 != NULL)
-    {
-      if (! mips_elf64_slurp_one_reloc_table (abfd, asect,
-                                             rel_hdr2, reloc_count2,
-                                             relents + reloc_count * 3,
-                                             symbols, dynamic))
-       return FALSE;
-    }
 
   asect->relocation = relents;
   return TRUE;
@@ -2827,7 +2826,7 @@ mips_elf64_write_relocs (bfd *abfd, asection *sec, void *data)
        }
     }
 
-  rel_hdr = &elf_section_data (sec)->rel_hdr;
+  rel_hdr = _bfd_elf_single_rel_hdr (sec);
 
   /* Do the actual relocation.  */
 
@@ -3083,7 +3082,7 @@ elf64_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
        elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
 
        /* pr_pid */
-       elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 32);
+       elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 32);
 
        /* pr_reg */
        offset = 112;
@@ -3207,6 +3206,7 @@ const struct elf_size_info mips_elf64_size_info =
 };
 
 #define ELF_ARCH                       bfd_arch_mips
+#define ELF_TARGET_ID                  MIPS_ELF_DATA
 #define ELF_MACHINE_CODE               EM_MIPS
 
 #define elf_backend_collect            TRUE
@@ -3285,7 +3285,6 @@ const struct elf_size_info mips_elf64_size_info =
 #define bfd_elf64_set_section_contents _bfd_mips_elf_set_section_contents
 #define bfd_elf64_bfd_get_relocated_section_contents \
                                _bfd_elf_mips_get_relocated_section_contents
-#define bfd_elf64_mkobject             _bfd_mips_elf_mkobject
 #define bfd_elf64_bfd_link_hash_table_create \
                                _bfd_mips_elf_link_hash_table_create
 #define bfd_elf64_bfd_final_link       _bfd_mips_elf_final_link
This page took 0.024466 seconds and 4 git commands to generate.