Skip gdb.threads/thread_events.exp on RSP targets properly
[binutils-gdb.git] / bfd / coff-sh.c
index e3e7fac3ef8900b5345873531d00c6795fd2b977..8170152b73991dc32850fb8faaa9676d14fafdb9 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for Renesas Super-H COFF binaries.
-   Copyright (C) 1993-2016 Free Software Foundation, Inc.
+   Copyright (C) 1993-2017 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    Written by Steve Chamberlain, <sac@cygnus.com>.
    Relaxing code written by Ian Lance Taylor, <ian@cygnus.com>.
@@ -596,6 +596,9 @@ sh_reloc (bfd *      abfd,
       && bfd_is_und_section (symbol_in->section))
     return bfd_reloc_undefined;
 
+  if (addr > input_section->size)
+    return bfd_reloc_outofrange;
+
   sym_value = get_symbol_value (symbol_in);
 
   switch (r_type)
@@ -771,8 +774,9 @@ sh_relax_section (bfd *abfd,
       laddr += ((irel->r_offset & 0xffffffff) ^ 0x80000000) - 0x80000000;
       if (laddr >= sec->size)
        {
-         _bfd_error_handler ("%B: 0x%lx: warning: bad R_SH_USES offset",
-                             abfd, (unsigned long) irel->r_vaddr);
+         /* xgettext: c-format */
+         _bfd_error_handler (_("%B: %#Lx: warning: bad R_SH_USES offset"),
+                             abfd, irel->r_vaddr);
          continue;
        }
       insn = bfd_get_16 (abfd, contents + laddr);
@@ -781,8 +785,9 @@ sh_relax_section (bfd *abfd,
       if ((insn & 0xf000) != 0xd000)
        {
          _bfd_error_handler
-           ("%B: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x",
-            abfd, (unsigned long) irel->r_vaddr, insn);
+           /* xgettext: c-format */
+           (_("%B: %#Lx: warning: R_SH_USES points to unrecognized insn %#x"),
+            abfd, irel->r_vaddr, insn);
          continue;
        }
 
@@ -798,8 +803,9 @@ sh_relax_section (bfd *abfd,
       if (paddr >= sec->size)
        {
          _bfd_error_handler
-           ("%B: 0x%lx: warning: bad R_SH_USES load offset",
-            abfd, (unsigned long) irel->r_vaddr);
+           /* xgettext: c-format */
+           (_("%B: %#Lx: warning: bad R_SH_USES load offset"),
+            abfd, irel->r_vaddr);
          continue;
        }
 
@@ -822,8 +828,9 @@ sh_relax_section (bfd *abfd,
       if (irelfn >= irelend)
        {
          _bfd_error_handler
-           ("%B: 0x%lx: warning: could not find expected reloc",
-            abfd, (unsigned long) paddr);
+           /* xgettext: c-format */
+           (_("%B: %#Lx: warning: could not find expected reloc"),
+            abfd, paddr);
          continue;
        }
 
@@ -838,8 +845,9 @@ sh_relax_section (bfd *abfd,
       if (sym.n_scnum != 0 && sym.n_scnum != sec->target_index)
        {
          _bfd_error_handler
-           ("%B: 0x%lx: warning: symbol in unexpected section",
-            abfd, (unsigned long) paddr);
+           /* xgettext: c-format */
+           (_("%B: %#Lx: warning: symbol in unexpected section"),
+            abfd, paddr);
          continue;
        }
 
@@ -963,8 +971,9 @@ sh_relax_section (bfd *abfd,
       if (irelcount >= irelend)
        {
          _bfd_error_handler
-           ("%B: 0x%lx: warning: could not find expected COUNT reloc",
-            abfd, (unsigned long) paddr);
+           /* xgettext: c-format */
+           (_("%B: %#Lx: warning: could not find expected COUNT reloc"),
+            abfd, paddr);
          continue;
        }
 
@@ -972,8 +981,9 @@ sh_relax_section (bfd *abfd,
          just deleted one.  */
       if (irelcount->r_offset == 0)
        {
-         _bfd_error_handler ("%B: 0x%lx: warning: bad count",
-                             abfd, (unsigned long) paddr);
+         /* xgettext: c-format */
+         _bfd_error_handler (_("%B: %#Lx: warning: bad count"),
+                             abfd, paddr);
          continue;
        }
 
@@ -1073,7 +1083,7 @@ sh_relax_delete_bytes (bfd *abfd,
 
   contents = coff_section_data (abfd, sec)->contents;
 
-  /* The deletion must stop at the next ALIGN reloc for an aligment
+  /* The deletion must stop at the next ALIGN reloc for an alignment
      power larger than the number of bytes we are deleting.  */
 
   irelalign = NULL;
@@ -1343,8 +1353,9 @@ sh_relax_delete_bytes (bfd *abfd,
          if (overflow)
            {
              _bfd_error_handler
-               ("%B: 0x%lx: fatal: reloc overflow while relaxing",
-                abfd, (unsigned long) irel->r_vaddr);
+               /* xgettext: c-format */
+               (_("%B: %#Lx: fatal: reloc overflow while relaxing"),
+                abfd, irel->r_vaddr);
              bfd_set_error (bfd_error_bad_value);
              return FALSE;
            }
@@ -1438,7 +1449,7 @@ sh_relax_delete_bytes (bfd *abfd,
       || obj_raw_syments (abfd) != NULL)
     {
       _bfd_error_handler
-       ("%B: fatal: generic symbols retrieved before relaxing", abfd);
+       (_("%B: fatal: generic symbols retrieved before relaxing"), abfd);
       bfd_set_error (bfd_error_invalid_operation);
       return FALSE;
     }
@@ -2630,8 +2641,9 @@ sh_swap_insns (bfd *      abfd,
          if (overflow)
            {
              _bfd_error_handler
-               ("%B: 0x%lx: fatal: reloc overflow while relaxing",
-                abfd, (unsigned long) irel->r_vaddr);
+               /* xgettext: c-format */
+               (_("%B: %#Lx: fatal: reloc overflow while relaxing"),
+                abfd, irel->r_vaddr);
              bfd_set_error (bfd_error_bad_value);
              return FALSE;
            }
@@ -2767,7 +2779,8 @@ sh_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
              || (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
            {
              _bfd_error_handler
-               ("%B: illegal symbol index %ld in relocs",
+               /* xgettext: c-format */
+               (_("%B: illegal symbol index %ld in relocs"),
                 input_bfd, symndx);
              bfd_set_error (bfd_error_bad_value);
              return FALSE;