elf_backend_relocate_section int vs. bfd_boolean
[deliverable/binutils-gdb.git] / bfd / elf32-xstormy16.c
index 4cd7e6273b88f5331dce9846b41331eab7ac1c41..005e45442557a8738b4614f5c3758eb8575eb1b8 100644 (file)
@@ -1,5 +1,5 @@
 /* Xstormy16-specific support for 32-bit ELF.
-   Copyright (C) 2000-2018 Free Software Foundation, Inc.
+   Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -471,7 +471,7 @@ xstormy16_elf_check_relocs (bfd *abfd,
                                                         flags);
              elf_hash_table (info)->splt = splt;
              if (splt == NULL
-                 || ! bfd_set_section_alignment (dynobj, splt, 1))
+                 || !bfd_set_section_alignment (splt, 1))
                return FALSE;
            }
 
@@ -513,9 +513,7 @@ xstormy16_elf_check_relocs (bfd *abfd,
          /* This relocation describes which C++ vtable entries are actually
             used.  Record for later use during GC.  */
        case R_XSTORMY16_GNU_VTENTRY:
-         BFD_ASSERT (h != NULL);
-         if (h != NULL
-             && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+         if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
            return FALSE;
          break;
        }
@@ -590,7 +588,8 @@ xstormy16_elf_relax_section (bfd *dynobj,
   /* Assume nothing changes.  */
   *again = FALSE;
 
-  if (bfd_link_relocatable (info))
+  if (bfd_link_relocatable (info)
+      || !is_elf_hash_table (info->hash))
     return TRUE;
 
   /* We only relax the .plt section at the moment.  */
@@ -760,7 +759,7 @@ xstormy16_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
    section, which means that the addend must be adjusted
    accordingly.  */
 
-static bfd_boolean
+static int
 xstormy16_elf_relocate_section (bfd *                  output_bfd ATTRIBUTE_UNUSED,
                                struct bfd_link_info *  info,
                                bfd *                   input_bfd,
@@ -836,7 +835,7 @@ xstormy16_elf_relocate_section (bfd *                       output_bfd ATTRIBUTE_UNUSED,
          name = (bfd_elf_string_from_elf_section
                  (input_bfd, symtab_hdr->sh_link, sym->st_name));
          if (name == NULL || *name == '\0')
-           name = bfd_section_name (input_bfd, sec);
+           name = bfd_section_name (sec);
        }
 
       switch (ELF32_R_TYPE (rel->r_info))
This page took 0.024424 seconds and 4 git commands to generate.