From 9d8aa300bb4038069b9021d556a735ee68ea4331 Mon Sep 17 00:00:00 2001 From: Jan Olbrechts Date: Thu, 29 Dec 2011 09:47:05 +0100 Subject: [PATCH] fixes for host gcc 4.6.1 --- toolchain/binutils/bfd/archive.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/toolchain/binutils/bfd/archive.c b/toolchain/binutils/bfd/archive.c index e539dd0f..491ca1cf 100755 --- a/toolchain/binutils/bfd/archive.c +++ b/toolchain/binutils/bfd/archive.c @@ -627,10 +627,7 @@ bfd_generic_archive_p (bfd *abfd) first = bfd_openr_next_archived_file (abfd, NULL); if (first != NULL) { - bfd_boolean fail; - first->target_defaulted = FALSE; - fail = FALSE; if (bfd_check_format (first, bfd_object) && first->xvec != abfd->xvec) { @@ -1364,7 +1361,9 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, const char *filename, bfd *member) strncpy (hdr->ar_fmag, ARFMAG, 2); /* Goddamned sprintf doesn't permit MAXIMUM field lengths. */ - sprintf ((hdr->ar_date), "%-12ld", (long) status.st_mtime); + char tmp_ar_date[13]; + sprintf (tmp_ar_date, "%-12ld", (long) status.st_mtime); + memcpy(&hdr->ar_date, tmp_ar_date, 12); #ifdef HPUX_LARGE_AR_IDS /* HP has a very "special" way to handle UID/GID's with numeric values > 99999. */ @@ -1381,7 +1380,9 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, const char *filename, bfd *member) else #endif sprintf ((hdr->ar_gid), "%ld", (long) status.st_gid); - sprintf ((hdr->ar_mode), "%-8o", (unsigned int) status.st_mode); + char tmp_ar_mode[10]; + sprintf (tmp_ar_mode, "%-8o", (unsigned int) status.st_mode); + memcpy(&hdr->ar_mode, tmp_ar_mode, 8); char tmpbuf[12]; // \0 and possibly - (negative) sprintf (tmpbuf, "%-10ld", (long) status.st_size); memcpy(hdr->ar_size, tmpbuf, 10); -- 2.11.4.GIT