diff options
author | Nick Clifton <nickc@redhat.com> | 2012-01-20 14:42:57 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2012-01-20 14:42:57 +0000 |
commit | f1bb16f888ae3230ecac7530db7b2dab3dcddfe2 (patch) | |
tree | c1353b3060a29ffcbedd7823afbc2412b1b98183 /bfd/archive64.c | |
parent | 2128eb399e7c8ad74793352fa88fdee4a5767fe8 (diff) | |
download | gdb-f1bb16f888ae3230ecac7530db7b2dab3dcddfe2.zip gdb-f1bb16f888ae3230ecac7530db7b2dab3dcddfe2.tar.gz gdb-f1bb16f888ae3230ecac7530db7b2dab3dcddfe2.tar.bz2 |
PR binutils/13534
* archive.c (_bfd_ar_sizepad): New function. Correctly install and
pad the size field in an archive header.
(_bfd_generic_read_ar_hdr_mag): Use the correct type and scan
function for the archive size field.
(bfd_generic_openr_next_archived_file): Likewise.
(do_slurp_coff_armap): Likewise.
(_bfd_write_archive_contents): Likewise.
(_bfd_bsd44_write_ar_hdr): Use the new function.
(bfd_ar_hdr_from_filesystem): Likewise.
(_bfd_write_archive_contents): Likewise.
(bsd_write_armap): Likewise.
(coff_write_armap): Likewise.
* archive64.c (bfd_elf64_archive_write_armap): Likewise.
* bfdio.c (bfd_bread): Use correct type for archive element
sizes.
* ar.c (open_inarch): Likewise.
(extract_file): Likewise.
* libbfd-in.h (struct areltdata): Use correct types for
parsed_size and extra_size fields.
Prototype _bfd_ar_sizepad function.
* libbfd.h: Regenerate.
Diffstat (limited to 'bfd/archive64.c')
-rw-r--r-- | bfd/archive64.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bfd/archive64.c b/bfd/archive64.c index bbc4c3f..f3a13d3 100644 --- a/bfd/archive64.c +++ b/bfd/archive64.c @@ -1,6 +1,6 @@ /* MIPS-specific support for 64-bit ELF Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, - 2010 Free Software Foundation, Inc. + 2010, 2012 Free Software Foundation, Inc. Ian Lance Taylor, Cygnus Support Linker support added by Mark Mitchell, CodeSourcery, LLC. <mark@codesourcery.com> @@ -169,8 +169,8 @@ bfd_elf64_archive_write_armap (bfd *arch, memset (&hdr, ' ', sizeof (struct ar_hdr)); memcpy (hdr.ar_name, "/SYM64/", strlen ("/SYM64/")); - _bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10ld", - mapsize); + if (!_bfd_ar_sizepad (hdr.ar_size, sizeof (hdr.ar_size), mapsize)) + return FALSE; _bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld", time (NULL)); /* This, at least, is what Intel coff sets the values to.: */ |