Fix %s that should be %B in several message formats.
[deliverable/binutils-gdb.git] / bfd / elf32-cr16.c
index f5e561e7dd1bf8c37abe878acf883f506e96dc5b..f82d1e902d78a3d5dcd704ede95f3d869281e69d 100644 (file)
@@ -1431,9 +1431,6 @@ elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
   struct elf_link_hash_entry **sym_hashes;
   Elf_Internal_Rela *rel, *relend;
 
-  if (info->relocatable)
-    return TRUE;
-
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (input_bfd);
 
@@ -1473,6 +1470,20 @@ elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                                    unresolved_reloc, warned);
         }
 
+      if (sec != NULL && elf_discarded_section (sec))
+       {
+         /* For relocs against symbols from removed linkonce sections,
+            or sections discarded by a linker script, we just want the
+            section contents zeroed.  Avoid any special processing.  */
+         _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset);
+         rel->r_info = 0;
+         rel->r_addend = 0;
+         continue;
+       }
+
+      if (info->relocatable)
+        continue;
+
       r = cr16_elf_final_link_relocate (howto, input_bfd, output_bfd,
                                         input_section,
                                         contents, rel->r_offset,
This page took 0.024436 seconds and 4 git commands to generate.