+2018-06-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/23146
+ * bfd-in.h: Include "diagnostics.h".
+ * bfd-in2.h: Regenerated.
+ * elf32-arm.c (elf32_arm_nabi_write_core_note): Use
+ DIAGNOSTIC_PUSH, DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION and
+ DIAGNOSTIC_POP to silence GCC 8.1 warnings with
+ -Wstringop-truncation.
+ * elf32-ppc.c (ppc_elf_write_core_note): Likewse.
+ * elf32-s390.c (elf_s390_write_core_note): Likewse.
+ * elf64-ppc.c (ppc64_elf_write_core_note): Likewse.
+ * elf64-s390.c (elf_s390_write_core_note): Likewse.
+ * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewse.
+
2018-06-03 Jim Wilson <jimw@sifive.com>
PR ld/23244
#include "ansidecl.h"
#include "symcat.h"
+#include "diagnostics.h"
#include <stdarg.h>
#include <sys/stat.h>
#include "ansidecl.h"
#include "symcat.h"
+#include "diagnostics.h"
#include <stdarg.h>
#include <sys/stat.h>
va_start (ap, note_type);
memset (data, 0, sizeof (data));
strncpy (data + 28, va_arg (ap, const char *), 16);
+ DIAGNOSTIC_PUSH;
+ /* GCC 8.1 warns about 80 equals destination size with
+ -Wstringop-truncation:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85643
+ */
+#if GCC_VERSION == 8001
+ DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION;
+#endif
strncpy (data + 44, va_arg (ap, const char *), 80);
+ DIAGNOSTIC_POP;
va_end (ap);
return elfcore_write_note (abfd, buf, bufsiz,
va_start (ap, note_type);
memset (data, 0, sizeof (data));
strncpy (data + 32, va_arg (ap, const char *), 16);
+ DIAGNOSTIC_PUSH;
+ /* GCC 8.1 warns about 80 equals destination size with
+ -Wstringop-truncation:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85643
+ */
+#if GCC_VERSION == 8001
+ DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION;
+#endif
strncpy (data + 48, va_arg (ap, const char *), 80);
+ DIAGNOSTIC_POP;
va_end (ap);
return elfcore_write_note (abfd, buf, bufsiz,
"CORE", note_type, data, sizeof (data));
va_end (ap);
strncpy (data + 28, fname, 16);
+ DIAGNOSTIC_PUSH;
+ /* GCC 8.1 warns about 80 equals destination size with
+ -Wstringop-truncation:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85643
+ */
+#if GCC_VERSION == 8001
+ DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION;
+#endif
strncpy (data + 44, psargs, 80);
+ DIAGNOSTIC_POP;
return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type,
&data, sizeof (data));
}
va_start (ap, note_type);
memset (data, 0, sizeof (data));
strncpy (data + 40, va_arg (ap, const char *), 16);
+ DIAGNOSTIC_PUSH;
+ /* GCC 8.1 warns about 80 equals destination size with
+ -Wstringop-truncation:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85643
+ */
+#if GCC_VERSION == 8001
+ DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION;
+#endif
strncpy (data + 56, va_arg (ap, const char *), 80);
+ DIAGNOSTIC_POP;
va_end (ap);
return elfcore_write_note (abfd, buf, bufsiz,
"CORE", note_type, data, sizeof (data));
va_end (ap);
strncpy (data + 40, fname, 16);
+ DIAGNOSTIC_PUSH;
+ /* GCC 8.1 warns about 80 equals destination size with
+ -Wstringop-truncation:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85643
+ */
+#if GCC_VERSION == 8001
+ DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION;
+#endif
strncpy (data + 56, psargs, 80);
+ DIAGNOSTIC_POP;
return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type,
&data, sizeof (data));
}
va_start (ap, note_type);
memset (data, 0, sizeof (data));
strncpy (data + 40, va_arg (ap, const char *), 16);
+ DIAGNOSTIC_PUSH;
+ /* GCC 8.1 warns about 80 equals destination size with
+ -Wstringop-truncation:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85643
+ */
+#if GCC_VERSION == 8001
+ DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION;
+#endif
strncpy (data + 56, va_arg (ap, const char *), 80);
+ DIAGNOSTIC_POP;
va_end (ap);
return elfcore_write_note (abfd, buf, bufsiz, "CORE",
+2018-06-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ * diagnostics.h (DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION): Always
+ define for GCC.
+
2018-06-04 H.J. Lu <hongjiu.lu@intel.com>
* diagnostics.h (DIAGNOSTIC_STRINGIFY_1): New.
# define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \
DIAGNOSTIC_IGNORE ("-Wunused-function")
-# if __GNUC__ == 8 && __GNUC_MINOR__ < 2
-# define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION \
+# define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION \
DIAGNOSTIC_IGNORE ("-Wstringop-truncation")
-# endif
#endif
#ifndef DIAGNOSTIC_IGNORE_SELF_MOVE