[PATCH] _bfd_ar_spacepad
Alan Modra
amodra@bigpond.net.au
Tue Mar 8 01:07:00 GMT 2005
On Mon, Mar 07, 2005 at 11:47:53AM +0100, Jakub Jelinek wrote:
> * libbfd-in.h (_bfd_ar_spacepad): New prototype.
> * libbfd.h: Rebuilt.
> * archive.c (_bfd_ar_spacepad): New function.
> (_bfd_construct_extended_name_table, _bfd_write_archive_contents,
> bsd_write_armap, _bfd_archive_bsd_update_armap_timestamp,
> coff_write_armap): Use it.
> (bfd_ar_hdr_from_filesystem): Likewise. Fix HP-UX large
> uid/gid support.
> * archive64.c (bfd_elf64_archive_write_armap): Use _bfd_ar_spacepad.
I like it.
> + _bfd_ar_spacepad (hdr->ar_name + 1, maxname - 1, "%-ld",
> + (unsigned) (strptr - *tabloc));
Remove the cast here, or make it (unsigned long). Seeing "%ld" and
(unsigned) just looks wrong when scanning the code.
> + _bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10ld",
> + (int) ((elength + 1) & ~(bfd_size_type) 1));
Similarly, use (long) here or remove the cast.
> + _bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10ld", (int) mapsize);
Likewise. Also in archive64.c.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
More information about the Binutils
mailing list