Add startswith function and use it instead of CONST_STRNEQ.
[deliverable/binutils-gdb.git] / bfd / elfxx-sparc.c
index 273789e5f7dd9e975a784a53fe8eb1d98240bbf5..c498d1cb70ba59d680cb1e708ff4273bdcf1f4b1 100644 (file)
@@ -1,5 +1,5 @@
 /* SPARC-specific support for ELF
-   Copyright (C) 2005-2020 Free Software Foundation, Inc.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -2540,7 +2540,7 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd,
          /* Strip this section if we don't need it; see the
             comment below.  */
        }
-      else if (CONST_STRNEQ (s->name, ".rela"))
+      else if (startswith (s->name, ".rela"))
        {
          if (s->size != 0)
            {
@@ -2904,7 +2904,25 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
                 STT_GNU_IFUNC symbol as STT_FUNC.  */
              if (elf_section_type (input_section) == SHT_NOTE)
                goto skip_ifunc;
-             abort ();
+
+             /* Dynamic relocs are not propagated for SEC_DEBUGGING
+                sections because such sections are not SEC_ALLOC and
+                thus ld.so will not process them.  */
+             if ((input_section->flags & SEC_ALLOC) == 0
+                 && (input_section->flags & SEC_DEBUGGING) != 0)
+               continue;
+
+             _bfd_error_handler
+               /* xgettext:c-format */
+               (_("%pB(%pA+%#" PRIx64 "): "
+                  "unresolvable %s relocation against symbol `%s'"),
+                input_bfd,
+                input_section,
+                (uint64_t) rel->r_offset,
+                howto->name,
+                h->root.root.string);
+             bfd_set_error (bfd_error_bad_value);
+             return FALSE;
            }
 
          plt_sec = htab->elf.splt;
This page took 0.024817 seconds and 4 git commands to generate.