Fix building with --enable-targets=all
[deliverable/binutils-gdb.git] / bfd / elf32-mips.c
index fe8686264174bbdfcdf8ccdc1c7f973620d76ef3..05c83ac56ae48329b3d038fd12b3620ef30dd607 100644 (file)
@@ -108,8 +108,10 @@ static void bfd_mips_elf32_swap_gptab_in
   PARAMS ((bfd *, const Elf32_External_gptab *, Elf32_gptab *));
 static void bfd_mips_elf32_swap_gptab_out
   PARAMS ((bfd *, const Elf32_gptab *, Elf32_External_gptab *));
+#if 0
 static void bfd_mips_elf_swap_msym_in 
   PARAMS ((bfd *, const Elf32_External_Msym *, Elf32_Internal_Msym *));
+#endif
 static void bfd_mips_elf_swap_msym_out
   PARAMS ((bfd *, const Elf32_Internal_Msym *, Elf32_External_Msym *));
 static boolean mips_elf_sym_is_global PARAMS ((bfd *, asymbol *));
@@ -2115,7 +2117,7 @@ bfd_mips_elf_swap_options_out (abfd, in, ex)
   bfd_h_put_16 (abfd, in->section, ex->section);
   bfd_h_put_32 (abfd, in->info, ex->info);
 }
-
+#if 0
 /* Swap in an MSYM entry.  */
 
 static void
@@ -2127,7 +2129,7 @@ bfd_mips_elf_swap_msym_in (abfd, ex, in)
   in->ms_hash_value = bfd_h_get_32 (abfd, ex->ms_hash_value);
   in->ms_info = bfd_h_get_32 (abfd, ex->ms_info);
 }
-
+#endif
 /* Swap out an MSYM entry.  */
 
 static void
@@ -5360,7 +5362,7 @@ mips_elf_got_page (abfd, info, value, offsetp)
   struct mips_got_info *g;
   bfd_byte *entry;
   bfd_byte *last_entry;
-  bfd_vma index;
+  bfd_vma index = 0;
   bfd_vma address;
 
   g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
@@ -5409,7 +5411,7 @@ mips_elf_got16_entry (abfd, info, value)
   struct mips_got_info *g;
   bfd_byte *entry;
   bfd_byte *last_entry;
-  bfd_vma index;
+  bfd_vma index = 0;
   bfd_vma address;
 
   /* Although the ABI says that it is "the high-order 16 bits" that we
@@ -5835,10 +5837,12 @@ mips_elf_calculate_relocation (abfd,
        }
       else
        {
-         (*info->callbacks->undefined_symbol)
-           (info, h->root.root.root.string, input_bfd,
-            input_section, relocation->r_offset);
-         return bfd_reloc_undefined;
+         if (! ((*info->callbacks->undefined_symbol)
+                (info, h->root.root.root.string, input_bfd,
+                 input_section, relocation->r_offset,
+                 (!info->shared || info->no_undefined))))
+           return bfd_reloc_undefined;
+         symbol = 0;
        }
 
       target_is_16_bit_code_p = (h->root.other == STO_MIPS16);
@@ -6103,6 +6107,7 @@ mips_elf_calculate_relocation (abfd,
 
     case R_MIPS_PC16:
       value = mips_elf_sign_extend (addend, 16) + symbol - p;
+      value = (bfd_vma) ((bfd_signed_vma) value / 4);
       overflowed_p = mips_elf_overflow_p (value, 16);
       break;
 
@@ -6412,7 +6417,7 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 {
   Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *relend;
-  bfd_vma addend;
+  bfd_vma addend = 0;
   boolean use_saved_addend_p = false;
   struct elf_backend_data *bed;
 
@@ -7919,7 +7924,7 @@ _bfd_mips_elf_size_dynamic_sections (output_bfd, info)
 
       if (strip)
        {
-         _bfd_strip_section_from_output (s);
+         _bfd_strip_section_from_output (info, s);
          continue;
        }
 
@@ -8714,7 +8719,8 @@ elf32_mips_get_relocated_section_contents (abfd, link_info, link_order, data,
                case bfd_reloc_undefined:
                  if (!((*link_info->callbacks->undefined_symbol)
                        (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
-                        input_bfd, input_section, (*parent)->address)))
+                        input_bfd, input_section, (*parent)->address,
+                        true)))
                    goto error_return;
                  break;
                case bfd_reloc_dangerous:
This page took 0.033776 seconds and 4 git commands to generate.