PR24827, Linker loops forever if unterminated multi-line comment in script
[deliverable/binutils-gdb.git] / bfd / elf64-ia64-vms.c
index 2b7e63b6e4842d096fa9cea662fb06281b61f45f..792b1cc6bd4df7f0d274e4f39ea5ce28f90e3875 100644 (file)
@@ -1,5 +1,5 @@
 /* IA-64 support for OpenVMS
-   Copyright (C) 1998-2018 Free Software Foundation, Inc.
+   Copyright (C) 1998-2019 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -240,13 +240,24 @@ static asection *get_got
 
 /* Given a ELF reloc, return the matching HOWTO structure.  */
 
-static void
+static bfd_boolean
 elf64_ia64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
                          arelent *bfd_reloc,
                          Elf_Internal_Rela *elf_reloc)
 {
-  bfd_reloc->howto
-    = ia64_elf_lookup_howto ((unsigned int) ELF64_R_TYPE (elf_reloc->r_info));
+  unsigned int r_type = ELF32_R_TYPE (elf_reloc->r_info);
+
+  bfd_reloc->howto = ia64_elf_lookup_howto (r_type);
+  if (bfd_reloc->howto == NULL)
+    {
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+                         abfd, r_type);
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
+
+  return TRUE;
 }
 
 
@@ -584,8 +595,8 @@ elf64_ia64_relax_section (bfd *abfd, asection *sec,
            {
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%pB: Can't relax br at %#" PRIx64 " in section `%pA'."
-                  " Please use brl or indirect branch."),
+               (_("%pB: can't relax br at %#" PRIx64 " in section `%pA';"
+                  " please use brl or indirect branch"),
                 sec->owner, (uint64_t) roff, sec);
              bfd_set_error (bfd_error_bad_value);
              goto error_return;
@@ -3434,6 +3445,11 @@ elf64_ia64_relocate_section (bfd *output_bfd,
        }
 
       howto = ia64_elf_lookup_howto (r_type);
+      if (howto == NULL)
+       {
+         ret_val = FALSE;
+         continue;
+       }
       r_symndx = ELF64_R_SYM (rel->r_info);
       h = NULL;
       sym = NULL;
@@ -5134,14 +5150,14 @@ error_free_dyn:
                  if (normal_bfd == NULL)
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("Warning: alignment %u of common symbol `%s' in %pB"
+                     (_("warning: alignment %u of common symbol `%s' in %pB"
                         " is greater than the alignment (%u) of its section %pA"),
                       1 << common_align, name, common_bfd,
                       1 << normal_align, h->root.u.def.section);
                  else
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("Warning: alignment %u of symbol `%s' in %pB"
+                     (_("warning: alignment %u of symbol `%s' in %pB"
                         " is smaller than %u in %pB"),
                       1 << normal_align, name, normal_bfd,
                       1 << common_align, common_bfd);
@@ -5157,7 +5173,7 @@ error_free_dyn:
                  && ! size_change_ok)
                _bfd_error_handler
                  /* xgettext:c-format */
-                 (_("Warning: size of symbol `%s' changed"
+                 (_("warning: size of symbol `%s' changed"
                     " from %" PRIu64 " in %pB to %" PRIu64 " in %pB"),
                   name, (uint64_t) h->size, old_bfd,
                   (uint64_t) isym->st_size, abfd);
@@ -5184,7 +5200,7 @@ error_free_dyn:
                  if (h->type != STT_NOTYPE && ! type_change_ok)
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("Warning: type of symbol `%s' changed"
+                     (_("warning: type of symbol `%s' changed"
                         " from %d to %d in %pB"),
                       name, h->type, type, abfd);
 
This page took 0.025903 seconds and 4 git commands to generate.