/* Support for the generic parts of most COFF variants, for BFD.
- Copyright (C) 1990-2016 Free Software Foundation, Inc.
+ Copyright (C) 1990-2017 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
/* 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;
}
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;
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;
}
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:
}
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
{
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;
}
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
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;
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
#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 = \
{ \