Automatic date update in version.in
[deliverable/binutils-gdb.git] / bfd / coffcode.h
index 2ef4e92533d2f29c34b4f7d4bc2f0efc62da4331..3331f4cc51cb5f22e8d4ebe61bd1d21d1d46397b 100644 (file)
@@ -965,7 +965,8 @@ handle_COMDAT (bfd * abfd,
          /* PR 17512 file: 078-11867-0.004  */
          if (symname == NULL)
            {
-             _bfd_error_handler (_("%B: unable to load COMDAT section name"), abfd);
+             _bfd_error_handler (_("%B: unable to load COMDAT section name"),
+                                 abfd);
              break;
            }
 
@@ -1005,7 +1006,8 @@ handle_COMDAT (bfd * abfd,
 
                if (isym.n_sclass == C_STAT && strcmp (name, symname) != 0)
                  /* xgettext:c-format */
-                 _bfd_error_handler (_("%B: warning: COMDAT symbol '%s' does not match section name '%s'"),
+                 _bfd_error_handler (_("%B: warning: COMDAT symbol '%s'"
+                                       " does not match section name '%s'"),
                                      abfd, symname, name);
 
                seen_state = 1;
@@ -1014,7 +1016,8 @@ handle_COMDAT (bfd * abfd,
                if (esym + bfd_coff_symesz (abfd) >= esymend)
                  {
                    /* xgettext:c-format */
-                   _bfd_error_handler (_("%B: warning: No symbol for section '%s' found"),
+                   _bfd_error_handler (_("%B: warning: No symbol for"
+                                         " section '%s' found"),
                                        abfd, symname);
                    break;
                  }
@@ -1239,7 +1242,8 @@ styp_to_sec_flags (bfd *abfd,
             variable as this will allow some .sys files generate by
             other toolchains to be processed.  See bugzilla issue 196.  */
          /* xgettext:c-format */
-         _bfd_error_handler (_("%B: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section %s"),
+         _bfd_error_handler (_("%B: Warning: Ignoring section flag"
+                               " IMAGE_SCN_MEM_NOT_PAGED in section %s"),
                              abfd, name);
          break;
        case IMAGE_SCN_MEM_EXECUTE:
@@ -1942,8 +1946,8 @@ coff_set_alignment_hook (bfd * abfd ATTRIBUTE_UNUSED,
     }
   else if (hdr->s_nreloc == 0xffff)
     _bfd_error_handler
-      (_("%s: warning: claims to have 0xffff relocs, without overflow"),
-       bfd_get_filename (abfd));
+      (_("%B: warning: claims to have 0xffff relocs, without overflow"),
+       abfd);
 }
 #undef ALIGN_SET
 #undef ELIFALIGN_SET
@@ -2784,7 +2788,8 @@ coff_write_relocs (bfd * abfd, int first_undef)
                      {
                        bfd_set_error (bfd_error_bad_value);
                        /* xgettext:c-format */
-                       _bfd_error_handler (_("%B: reloc against a non-existant symbol index: %ld"),
+                       _bfd_error_handler (_("%B: reloc against a non-existent"
+                                             " symbol index: %ld"),
                                            abfd, n.r_symndx);
                        return FALSE;
                      }
@@ -3755,7 +3760,9 @@ coff_write_object_contents (bfd * abfd)
                 NUL-terminated.  We use a temporary buffer so that we can still
                 sprintf all eight chars without splatting a terminating NUL
                 over the first byte of the following member (s_paddr).  */
-             char s_name_buf[SCNNMLEN + 1];
+             /* PR 21096: The +20 is to stop a bogus warning from gcc7 about
+                a possible buffer overflow.  */
+             char s_name_buf[SCNNMLEN + 1 + 20];
 
              /* An inherent limitation of the /nnnnnnn notation used to indicate
                 the offset of the long name in the string table is that we
@@ -3765,14 +3772,15 @@ coff_write_object_contents (bfd * abfd)
                  bfd_set_error (bfd_error_file_too_big);
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%B: section %s: string table overflow at offset %ld"),
-                   abfd, current->name, string_size);
+                   (_("%B: section %A: string table overflow at offset %ld"),
+                   abfd, current, string_size);
                  return FALSE;
                }
 
-             /* snprintf not strictly necessary now we've verified the value
-                has less than eight ASCII digits, but never mind.  */
-             snprintf (s_name_buf, SCNNMLEN + 1, "/%lu", (unsigned long) string_size);
+             /* We do not need to use snprintf here as we have already verfied
+                that string_size is not too big, plus we have an overlarge
+                buffer, just in case.  */
+             sprintf (s_name_buf, "/%lu", (unsigned long) string_size);
              /* Then strncpy takes care of any padding for us.  */
              strncpy (section.s_name, s_name_buf, SCNNMLEN);
              string_size += len + 1;
@@ -5431,6 +5439,10 @@ coff_canonicalize_reloc (bfd * abfd,
   return section->reloc_count;
 }
 
+#ifndef coff_set_reloc
+#define coff_set_reloc _bfd_generic_set_reloc
+#endif
+
 #ifndef coff_reloc16_estimate
 #define coff_reloc16_estimate dummy_reloc16_estimate
 
@@ -6049,6 +6061,10 @@ static bfd_coff_backend_data bigobj_swap_table =
 #define coff_bfd_define_common_symbol      bfd_generic_define_common_symbol
 #endif
 
+#ifndef coff_bfd_define_start_stop
+#define coff_bfd_define_start_stop         bfd_generic_define_start_stop
+#endif
+
 #define CREATE_BIG_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE, SWAP_TABLE)    \
 const bfd_target VAR =                                                 \
 {                                                                      \
This page took 0.025544 seconds and 4 git commands to generate.